| 1 | /* |
| 2 | * L4_MABX.c |
| 3 | * |
| 4 | * Code generation for model "L4_MABX". |
| 5 | * |
| 6 | * Model version : 1.898 |
| 7 | * Simulink Coder version : 8.14 (R2018a) 06-Feb-2018 |
| 8 | * C source code generated on : Thu Feb 27 17:58:03 2020 |
| 9 | * |
| 10 | * Target selection: rti1401.tlc |
| 11 | * Note: GRT includes extra infrastructure and instrumentation for prototyping |
| 12 | * Embedded hardware selection: Custom Processor->Custom |
| 13 | * Code generation objectives: Unspecified |
| 14 | * Validation result: Not run |
| 15 | */ |
| 16 | |
| 17 | #include "L4_MABX_trc_ptr.h" |
| 18 | #include "L4_MABX.h" |
| 19 | #include "L4_MABX_private.h" |
| 20 | |
| 21 | /* Named constants for Chart: '<S79>/Chart' */ |
| 22 | #define L4_MABX_IN_Init ((uint8_T)1U) |
| 23 | #define L4_MABX_IN_NO_ACTIVE_CHILD ((uint8_T)0U) |
| 24 | #define L4_MABX_IN_OperatorDisabled ((uint8_T)2U) |
| 25 | #define L4_MABX_IN_OperatorEnabled ((uint8_T)3U) |
| 26 | |
| 27 | /* Named constants for Chart: '<S211>/Relay_control_state_machine' */ |
| 28 | #define L4_MABX_IN_IGN_RELAY_LATCH ((uint8_T)1U) |
| 29 | #define L4_MABX_IN_IGN_RELAY_UNLATCH ((uint8_T)1U) |
| 30 | #define L4_MABX_IN_INITIAL ((uint8_T)1U) |
| 31 | #define L4_MABX_IN_INV_RELAY_LATCH ((uint8_T)2U) |
| 32 | #define L4_MABX_IN_INV_RELAY_UNLATCH ((uint8_T)2U) |
| 33 | #define L4_MABX_IN_MABX_RELAY_LATCH ((uint8_T)3U) |
| 34 | #define L4_MABX_IN_MABX_RELAY_UNLATCH ((uint8_T)3U) |
| 35 | #define L4_MABX_IN_POWER_DOWN_ROUTINE ((uint8_T)2U) |
| 36 | #define L4_MABX_IN_POWER_UP_ROUTINE ((uint8_T)3U) |
| 37 | #define L4_MABX_IN_SENSOR_RELAY_LATCH ((uint8_T)4U) |
| 38 | #define L4_MABX_IN_SENSOR_RELAY_UNLATCH ((uint8_T)4U) |
| 39 | #define L4_MABX_IN_WAIT ((uint8_T)5U) |
| 40 | |
| 41 | /* Named constants for Chart: '<S283>/Chart' */ |
| 42 | #define L4_MABX_IN_OneLane ((uint8_T)1U) |
| 43 | #define L4_MABX_IN_OneLane1 ((uint8_T)2U) |
| 44 | #define L4_MABX_IN_TwoLanes ((uint8_T)3U) |
| 45 | #define L4_MABX_IN_TwoLanes1 ((uint8_T)4U) |
| 46 | #define L4_MABX_IN_ZeroLanes ((uint8_T)5U) |
| 47 | #define L4_MABX_IN_ZeroLanes1 ((uint8_T)6U) |
| 48 | #define L4_MABX_IN_init_a ((uint8_T)7U) |
| 49 | |
| 50 | /* Named constants for Chart: '<S769>/Health State Machine PWM Sensor 1' */ |
| 51 | #define L4_MABX_IN_ERROR ((uint8_T)1U) |
| 52 | #define L4_MABX_IN_FAILURE_DETECTED ((uint8_T)1U) |
| 53 | #define L4_MABX_IN_NO_FAILURE ((uint8_T)2U) |
| 54 | #define L4_MABX_IN_PENDING ((uint8_T)2U) |
| 55 | |
| 56 | /* Named constants for Chart: '<S851>/Chart' */ |
| 57 | #define L4_MABX_IN_DiagPassed ((uint8_T)1U) |
| 58 | #define L4_MABX_IN_SwitchOff ((uint8_T)2U) |
| 59 | #define L4_MABX_IN_SwitchOn ((uint8_T)3U) |
| 60 | #define L4_MABX_IN_init_p ((uint8_T)4U) |
| 61 | |
| 62 | /* Named constants for Chart: '<S865>/Chart' */ |
| 63 | #define L4_MABX_IN_CheckPacketCount ((uint8_T)1U) |
| 64 | #define L4_MABX_IN_Init_l ((uint8_T)2U) |
| 65 | #define L4_MABX_IN_InterframeDelay ((uint8_T)3U) |
| 66 | #define L4_MABX_IN_InterframeDelay1 ((uint8_T)4U) |
| 67 | #define L4_MABX_IN_SendTPCM ((uint8_T)5U) |
| 68 | #define L4_MABX_IN_SendTPDT ((uint8_T)6U) |
| 69 | #define L4_MABX_IN_StartMsg ((uint8_T)7U) |
| 70 | #define L4_MABX_IN_WaitForNextPeriod ((uint8_T)8U) |
| 71 | |
| 72 | /* Exported block signals */ |
| 73 | real_T GLB_Absolute_Timestamp; /* '<S423>/Rate Transition' */ |
| 74 | real_T ReAX_ActualHandwheelPos; /* '<S449>/Switch' */ |
| 75 | real_T EthernetLinkStatus; /* '<S405>/dsa_tcpip_setup' */ |
| 76 | real_T CurrentAzimuth_rad; /* '<S403>/Switch' */ |
| 77 | real_T TargetAzimuth_rad; /* '<S403>/Switch1' */ |
| 78 | real_T TargetVelocity_kph; /* '<S403>/Switch3' */ |
| 79 | real_T Curvature; /* '<S403>/Switch4' */ |
| 80 | real_T CrosstrackError; /* '<S403>/Switch5' */ |
| 81 | real_T CurrentVelocity_kph; /* '<S403>/Switch2' */ |
| 82 | real_T GPS_X; /* '<S403>/Switch6' */ |
| 83 | real_T GPS_Y; /* '<S403>/Switch7' */ |
| 84 | real_T GPS_Time; /* '<S403>/Switch8' */ |
| 85 | real_T ReAX_EchoedSteerWheelPos; /* '<S449>/Switch' */ |
| 86 | real_T SteerWheelAngle; /* '<S651>/S-Function1' */ |
| 87 | real_T YawRate; /* '<S651>/S-Function1' */ |
| 88 | real_T SPN1810_LongitudinalAcceleration;/* '<S651>/S-Function1' */ |
| 89 | real_T WheelBasedVehicleSpeed; /* '<S512>/S-Function1' */ |
| 90 | real_T BrakeSwitch; /* '<S512>/S-Function1' */ |
| 91 | real_T Lateral_Control_Rate_Limit; /* '<S316>/Constant' */ |
| 92 | real_T Lateral_Control_Output; /* '<S281>/Sum1' */ |
| 93 | real_T Lateral_Control_Rate_Limiter_Output;/* '<S316>/If_Then_Else' */ |
| 94 | real_T Stanley_Rate_Limit; /* '<S301>/Multiport Switch2' */ |
| 95 | real_T Stanley_Set_Gain; /* '<S280>/Multiport Switch1' */ |
| 96 | real_T Understeer_Correction_Output; /* '<S280>/Multiport Switch2' */ |
| 97 | real_T Stanley_Output; /* '<S280>/Sum1' */ |
| 98 | real_T Stanley_Rate_Limiter_Output; /* '<S301>/If_Then_Else' */ |
| 99 | real_T SteerCommandDeg; /* '<S80>/sign flip' */ |
| 100 | real_T DesiredSteeringAngle; /* '<S80>/sign2' */ |
| 101 | real_T Lateral_Control_Heading_Error; /* '<S281>/Error Calc' */ |
| 102 | uint32_T DIAG_CAN1_Count_Stuff_Errors; /* '<S28>/S-Function1' */ |
| 103 | uint32_T DIAG_CAN1_Count_Format_Errors;/* '<S28>/S-Function1' */ |
| 104 | uint32_T DIAG_CAN1_Count_Ack_Errors; /* '<S28>/S-Function1' */ |
| 105 | uint32_T DIAG_CAN1_Count_Bit0_Errors; /* '<S28>/S-Function1' */ |
| 106 | uint32_T DIAG_CAN1_Count_Bit1_Errors; /* '<S28>/S-Function1' */ |
| 107 | uint32_T DIAG_CAN1_Count_CRC_Errors; /* '<S28>/S-Function1' */ |
| 108 | uint32_T DIAG_CAN1_Count_RX_Lost; /* '<S28>/S-Function1' */ |
| 109 | uint32_T DIAG_CAN1_Count_RX_OK; /* '<S28>/S-Function1' */ |
| 110 | uint32_T DIAG_CAN1_Count_TX_OK; /* '<S28>/S-Function1' */ |
| 111 | uint32_T DIAG_CAN5_Count_Stuff_Errors; /* '<S20>/S-Function1' */ |
| 112 | uint32_T DIAG_CAN5_Count_Format_Errors;/* '<S20>/S-Function1' */ |
| 113 | uint32_T DIAG_CAN5_Count_Ack_Errors; /* '<S20>/S-Function1' */ |
| 114 | uint32_T DIAG_CAN5_Count_Bit0_Errors; /* '<S20>/S-Function1' */ |
| 115 | uint32_T DIAG_CAN5_Count_Bit1_Errors; /* '<S20>/S-Function1' */ |
| 116 | uint32_T DIAG_CAN5_Count_CRC_Errors; /* '<S20>/S-Function1' */ |
| 117 | uint32_T DIAG_CAN5_Count_RX_Lost; /* '<S20>/S-Function1' */ |
| 118 | uint32_T DIAG_CAN5_Count_RX_OK; /* '<S20>/S-Function1' */ |
| 119 | uint32_T DIAG_CAN5_Count_TX_OK; /* '<S20>/S-Function1' */ |
| 120 | uint32_T DIAG_CAN6_Count_Stuff_Errors; /* '<S21>/S-Function1' */ |
| 121 | uint32_T DIAG_CAN6_Count_Format_Errors;/* '<S21>/S-Function1' */ |
| 122 | uint32_T DIAG_CAN6_Count_Ack_Errors; /* '<S21>/S-Function1' */ |
| 123 | uint32_T DIAG_CAN6_Count_Bit0_Errors; /* '<S21>/S-Function1' */ |
| 124 | uint32_T DIAG_CAN6_Count_Bit1_Errors; /* '<S21>/S-Function1' */ |
| 125 | uint32_T DIAG_CAN6_Count_CRC_Errors; /* '<S21>/S-Function1' */ |
| 126 | uint32_T DIAG_CAN6_Count_RX_Lost; /* '<S21>/S-Function1' */ |
| 127 | uint32_T DIAG_CAN6_Count_RX_OK; /* '<S21>/S-Function1' */ |
| 128 | uint32_T DIAG_CAN6_Count_TX_OK; /* '<S21>/S-Function1' */ |
| 129 | uint32_T DIAG_CAN3_Count_Stuff_Errors; /* '<S18>/S-Function1' */ |
| 130 | uint32_T DIAG_CAN3_Count_Format_Errors;/* '<S18>/S-Function1' */ |
| 131 | uint32_T DIAG_CAN3_Count_Ack_Errors; /* '<S18>/S-Function1' */ |
| 132 | uint32_T DIAG_CAN3_Count_Bit0_Errors; /* '<S18>/S-Function1' */ |
| 133 | uint32_T DIAG_CAN3_Count_Bit1_Errors; /* '<S18>/S-Function1' */ |
| 134 | uint32_T DIAG_CAN3_Count_CRC_Errors; /* '<S18>/S-Function1' */ |
| 135 | uint32_T DIAG_CAN3_Count_RX_Lost; /* '<S18>/S-Function1' */ |
| 136 | uint32_T DIAG_CAN3_Count_RX_OK; /* '<S18>/S-Function1' */ |
| 137 | uint32_T DIAG_CAN3_Count_TX_OK; /* '<S18>/S-Function1' */ |
| 138 | uint32_T DIAG_CAN4_Count_Stuff_Errors; /* '<S19>/S-Function1' */ |
| 139 | uint32_T DIAG_CAN4_Count_Format_Errors;/* '<S19>/S-Function1' */ |
| 140 | uint32_T DIAG_CAN4_Count_Ack_Errors; /* '<S19>/S-Function1' */ |
| 141 | uint32_T DIAG_CAN4_Count_Bit0_Errors; /* '<S19>/S-Function1' */ |
| 142 | uint32_T DIAG_CAN4_Count_Bit1_Errors; /* '<S19>/S-Function1' */ |
| 143 | uint32_T DIAG_CAN4_Count_CRC_Errors; /* '<S19>/S-Function1' */ |
| 144 | uint32_T DIAG_CAN4_Count_RX_Lost; /* '<S19>/S-Function1' */ |
| 145 | uint32_T DIAG_CAN4_Count_RX_OK; /* '<S19>/S-Function1' */ |
| 146 | uint32_T DIAG_CAN4_Count_TX_OK; /* '<S19>/S-Function1' */ |
| 147 | uint32_T DIAG_CAN2_Count_Stuff_Errors; /* '<S17>/S-Function1' */ |
| 148 | uint32_T DIAG_CAN2_Count_Format_Errors;/* '<S17>/S-Function1' */ |
| 149 | uint32_T DIAG_CAN2_Count_Ack_Errors; /* '<S17>/S-Function1' */ |
| 150 | uint32_T DIAG_CAN2_Count_Bit0_Errors; /* '<S17>/S-Function1' */ |
| 151 | uint32_T DIAG_CAN2_Count_Bit1_Errors; /* '<S17>/S-Function1' */ |
| 152 | uint32_T DIAG_CAN2_Count_CRC_Errors; /* '<S17>/S-Function1' */ |
| 153 | uint32_T DIAG_CAN2_Count_RX_Lost; /* '<S17>/S-Function1' */ |
| 154 | uint32_T DIAG_CAN2_Count_RX_OK; /* '<S17>/S-Function1' */ |
| 155 | uint32_T DIAG_CAN2_Count_TX_OK; /* '<S17>/S-Function1' */ |
| 156 | real32_T REAX_Handwheel_Torque; /* '<S425>/Data Type Conversion3' */ |
| 157 | real32_T REAX_Handwheel_Velocity; /* '<S425>/Data Type Conversion4' */ |
| 158 | real32_T REAX_Pull_Compensation; /* '<S425>/Data Type Conversion5' */ |
| 159 | ENUM_CAN_STATUS_DIAG_T DIAG_CAN1_Status;/* '<S1>/Data Type Conversion' */ |
| 160 | ENUM_CAN_STATUS_DIAG_T DIAG_CAN5_Status;/* '<S1>/Data Type Conversion5' */ |
| 161 | ENUM_CAN_STATUS_DIAG_T DIAG_CAN6_Status;/* '<S1>/Data Type Conversion4' */ |
| 162 | ENUM_CAN_STATUS_DIAG_T DIAG_CAN3_Status;/* '<S1>/Data Type Conversion3' */ |
| 163 | ENUM_CAN_STATUS_DIAG_T DIAG_CAN4_Status;/* '<S1>/Data Type Conversion2' */ |
| 164 | ENUM_CAN_STATUS_DIAG_T DIAG_CAN2_Status;/* '<S1>/Data Type Conversion1' */ |
| 165 | uint8_T SupervisorMode; /* '<S403>/Switch9' */ |
| 166 | uint8_T REAX_Current_Mode; /* '<S425>/Data Type Conversion' */ |
| 167 | uint8_T REAX_Req_Mode; /* '<S425>/Data Type Conversion1' */ |
| 168 | uint8_T REAX_Status; /* '<S425>/Data Type Conversion2' */ |
| 169 | uint8_T GLB_SWVERSION_CPV_[100]; /* '<S1096>/Constant' */ |
| 170 | uint8_T MABX_Mode; /* '<S76>/Switch' */ |
| 171 | boolean_T EStop; /* '<S422>/Logical Operator1' */ |
| 172 | boolean_T EnableSw; /* '<S751>/Switch' */ |
| 173 | boolean_T EngagePB; /* '<S749>/AND2' */ |
| 174 | boolean_T BrakeSW; /* '<S422>/Logical Operator3' */ |
| 175 | boolean_T MABX_Heartbeat; /* '<S404>/Cast To Boolean' */ |
| 176 | boolean_T Heartbeat_Ok; /* '<S409>/Switch1' */ |
| 177 | boolean_T RTMapsOk; /* '<S403>/AND' */ |
| 178 | boolean_T LogEventPB; /* '<S748>/AND2' */ |
| 179 | boolean_T AutonomousOutputEnabled; /* '<S76>/Autonomous Mode Switch' */ |
| 180 | boolean_T Stanley_Limiter_Active; /* '<S302>/Compare' */ |
| 181 | boolean_T RateLimiterActive; /* '<S325>/Compare' */ |
| 182 | real_T Pedal_pwm_position; /* '<S771>/Switch' */ |
| 183 | |
| 184 | /* Exported block parameters */ |
| 185 | real_T APTC_PEDAL_LOW_IDLE_SW_THR_APV = 3.0;/* Variable: APTC_PEDAL_LOW_IDLE_SW_THR_APV |
| 186 | * Referenced by: '<S75>/Constant' |
| 187 | */ |
| 188 | real_T APTC_TRQ_PED_INV_MAP_PED_POS_MPV[1328] = { 0.0, 0.3125, 0.859375, 1.15625, |
| 189 | 1.59375, 1.8125, 1.921875, 2.375, 3.8125, 4.3125, 4.84375, 4.96875, 5.71875, |
| 190 | 6.28125, 6.5625, 6.890625, 7.0, 7.8606557377049, 9.1229508196721, |
| 191 | 10.327868852459, 11.532786885246, 14.0, 15.25748502994, 15.425149700599, |
| 192 | 15.718562874251, 16.808383233533, 17.730538922156, 18.023952095808, |
| 193 | 18.275449101796, 18.904191616766, 19.449101796407, 19.658682634731, |
| 194 | 19.74251497006, 19.826347305389, 20.287425149701, 21.0, 21.516393442623, |
| 195 | 22.290983606557, 23.409836065574, 24.758196721311, 24.959016393443, |
| 196 | 25.217213114754, 26.22131147541, 26.995901639344, 27.311475409836, |
| 197 | 27.454918032787, 27.512295081967, 27.684426229508, 28.0, 32.101910828025, |
| 198 | 32.235668789809, 34.687898089172, 35.0, 36.734104046243, 38.815028901734, |
| 199 | 42.28323699422, 42.514450867052, 44.364161849711, 51.878612716763, 55.0, |
| 200 | 72.260273972603, 79.041095890411, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 201 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 202 | 100.0, 100.0, 100.0, 100.0, 0.0, 0.33333333333333, 0.91666666666667, |
| 203 | 1.2333333333333, 1.7, 1.9333333333333, 2.05, 2.5333333333333, 4.0666666666667, |
| 204 | 4.6, 5.1666666666667, 5.3, 6.1, 6.7, 7.0, 8.3738317757009, 8.8317757009346, |
| 205 | 9.8130841121495, 11.252336448598, 12.626168224299, 14.0, 15.559585492228, |
| 206 | 16.647668393782, 16.79274611399, 17.046632124352, 17.989637305699, |
| 207 | 18.787564766839, 19.041450777202, 19.259067357513, 19.80310880829, |
| 208 | 20.274611398964, 20.455958549223, 20.528497409326, 20.60103626943, 21.0, |
| 209 | 21.476, 21.98, 22.736, 23.828, 25.144, 25.34, 25.592, 26.572, 27.328, 27.636, |
| 210 | 27.776, 27.832, 28.0, 28.478260869565, 32.478260869565, 32.608695652174, 35.0, |
| 211 | 35.777777777778, 37.444444444444, 39.444444444444, 42.777777777778, 43.0, |
| 212 | 44.777777777778, 52.0, 55.0, 61.237623762376, 63.688118811881, 71.262376237624, |
| 213 | 75.160891089109, 78.613861386139, 96.769801980198, 97.660891089109, |
| 214 | 98.329207920792, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 215 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 0.57377049180328, |
| 216 | 1.577868852459, 2.1229508196721, 2.9262295081967, 3.327868852459, |
| 217 | 3.5286885245902, 4.3606557377049, 7.0, 7.8549618320611, 8.763358778626, |
| 218 | 8.9770992366412, 10.259541984733, 11.221374045802, 11.702290076336, |
| 219 | 12.263358778626, 12.450381679389, 12.851145038168, 13.43893129771, 14.0, |
| 220 | 14.757731958763, 16.309278350515, 17.39175257732, 17.536082474227, |
| 221 | 17.788659793814, 18.726804123711, 19.520618556701, 19.773195876289, |
| 222 | 19.989690721649, 20.530927835052, 21.0, 21.132575757576, 21.185606060606, |
| 223 | 21.238636363636, 21.530303030303, 21.981060606061, 22.458333333333, |
| 224 | 23.174242424242, 24.208333333333, 25.454545454545, 25.640151515152, |
| 225 | 25.878787878788, 26.806818181818, 27.522727272727, 27.814393939394, |
| 226 | 27.94696969697, 28.0, 28.202898550725, 28.574879227053, 31.685990338164, |
| 227 | 31.787439613527, 33.647342995169, 33.884057971014, 34.391304347826, 35.0, |
| 228 | 36.704545454545, 36.818181818182, 37.727272727273, 41.420454545455, |
| 229 | 42.954545454545, 46.136363636364, 47.386363636364, 51.25, 53.238636363636, |
| 230 | 55.0, 64.249684741488, 64.703656998739, 65.044136191677, 65.895334174023, |
| 231 | 75.769230769231, 79.457755359395, 82.919293820933, 84.451450189155, |
| 232 | 93.417402269861, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 233 | 0.0, 0.92105263157895, 2.5328947368421, 3.4078947368421, 4.6973684210526, |
| 234 | 5.3421052631579, 5.6644736842105, 7.0, 8.9339339339339, 9.6066066066066, |
| 235 | 10.321321321321, 10.489489489489, 11.498498498498, 12.255255255255, |
| 236 | 12.633633633634, 13.075075075075, 13.222222222222, 13.537537537538, 14.0, |
| 237 | 14.65625, 15.3125, 16.65625, 17.59375, 17.71875, 17.9375, 18.75, 19.4375, |
| 238 | 19.65625, 19.84375, 20.3125, 20.71875, 20.875, 20.9375, 21.0, 21.310483870968, |
| 239 | 21.790322580645, 22.298387096774, 23.060483870968, 24.161290322581, |
| 240 | 25.487903225806, 25.685483870968, 25.939516129032, 26.927419354839, |
| 241 | 27.689516129032, 28.0, 28.143442622951, 28.200819672131, 28.372950819672, |
| 242 | 28.688524590164, 31.327868852459, 31.41393442623, 32.991803278689, |
| 243 | 33.19262295082, 33.622950819672, 34.139344262295, 35.0, 35.082474226804, |
| 244 | 35.742268041237, 38.422680412371, 39.536082474227, 41.845360824742, |
| 245 | 42.752577319588, 45.556701030928, 47.0, 48.278350515464, 55.0, 55.39603960396, |
| 246 | 55.693069306931, 56.435643564356, 65.049504950495, 68.267326732673, |
| 247 | 71.287128712871, 72.623762376238, 80.445544554455, 86.188118811881, |
| 248 | 97.326732673267, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, |
| 249 | 1.2068965517241, 3.3189655172414, 4.4655172413793, 6.1551724137931, 7.0, |
| 250 | 7.1412103746398, 7.7262247838617, 9.5821325648415, 10.227665706052, |
| 251 | 10.913544668588, 11.07492795389, 12.043227665706, 12.769452449568, |
| 252 | 13.132564841499, 13.556195965418, 13.697406340058, 14.0, 14.599221789883, |
| 253 | 15.171206225681, 15.743190661479, 16.91439688716, 17.731517509728, |
| 254 | 17.84046692607, 18.031128404669, 18.739299610895, 19.338521400778, |
| 255 | 19.529182879377, 19.692607003891, 20.101167315175, 20.455252918288, |
| 256 | 20.591439688716, 20.645914396887, 20.700389105058, 21.0, 21.526548672566, |
| 257 | 22.08407079646, 22.920353982301, 24.128318584071, 25.58407079646, |
| 258 | 25.800884955752, 26.079646017699, 27.163716814159, 28.0, 28.282051282051, |
| 259 | 28.410256410256, 28.461538461538, 28.615384615385, 28.897435897436, |
| 260 | 31.25641025641, 31.333333333333, 32.74358974359, 32.923076923077, |
| 261 | 33.307692307692, 33.769230769231, 34.538461538462, 34.589743589744, 35.0, |
| 262 | 36.768707482993, 37.503401360544, 39.027210884354, 39.625850340136, |
| 263 | 41.47619047619, 42.428571428571, 43.272108843537, 47.707482993197, |
| 264 | 47.925170068027, 48.08843537415, 48.496598639456, 53.231292517007, 55.0, |
| 265 | 57.99672489083, 59.323144104803, 67.085152838428, 72.78384279476, |
| 266 | 83.837336244541, 86.490174672489, 91.550218340611, 99.312227074236, 100.0, |
| 267 | 100.0, 100.0, 100.0, 0.0, 1.8918918918919, 5.2027027027027, 7.0, |
| 268 | 7.5340599455041, 7.8010899182561, 7.9346049046322, 8.4877384196185, |
| 269 | 10.242506811989, 10.852861035422, 11.50136239782, 11.653950953678, |
| 270 | 12.569482288828, 13.256130790191, 13.599455040872, 14.0, 14.185606060606, |
| 271 | 14.583333333333, 15.166666666667, 15.723484848485, 16.280303030303, |
| 272 | 17.420454545455, 18.215909090909, 18.32196969697, 18.507575757576, |
| 273 | 19.19696969697, 19.780303030303, 19.965909090909, 20.125, 20.522727272727, |
| 274 | 20.867424242424, 21.0, 21.065420560748, 21.130841121495, 21.490654205607, |
| 275 | 22.046728971963, 22.635514018692, 23.518691588785, 24.794392523364, |
| 276 | 26.331775700935, 26.560747663551, 26.855140186916, 28.0, 28.665492957746, |
| 277 | 28.93661971831, 29.05985915493, 29.109154929577, 29.257042253521, |
| 278 | 29.528169014085, 31.795774647887, 31.869718309859, 33.225352112676, |
| 279 | 33.397887323944, 33.767605633803, 34.211267605634, 34.950704225352, 35.0, |
| 280 | 35.381406436234, 36.930870083433, 37.574493444577, 38.909415971395, |
| 281 | 39.433849821216, 41.054827175209, 41.88915375447, 42.628128724672, |
| 282 | 46.513706793802, 46.704410011919, 46.847437425507, 47.205005959476, |
| 283 | 51.352800953516, 52.902264600715, 54.356376638856, 55.0, 62.917594654788, |
| 284 | 68.730512249443, 80.005567928731, 82.711581291759, 87.873051224944, |
| 285 | 95.790645879733, 96.492204899777, 100.0, 100.0, 100.0, 0.0, 7.0, |
| 286 | 7.8448275862069, 8.3034482758621, 8.9793103448276, 9.3172413793103, |
| 287 | 9.4862068965517, 10.186206896552, 12.406896551724, 13.179310344828, 14.0, |
| 288 | 14.157303370787, 15.101123595506, 15.808988764045, 16.162921348315, |
| 289 | 16.575842696629, 16.713483146067, 17.008426966292, 17.441011235955, |
| 290 | 17.85393258427, 18.266853932584, 19.112359550562, 19.702247191011, |
| 291 | 19.780898876404, 19.918539325843, 20.429775280899, 20.862359550562, 21.0, |
| 292 | 21.192660550459, 21.674311926606, 22.091743119266, 22.252293577982, |
| 293 | 22.316513761468, 22.380733944954, 22.733944954128, 23.279816513761, |
| 294 | 23.857798165138, 24.724770642202, 25.977064220183, 27.48623853211, |
| 295 | 27.711009174312, 28.0, 28.910780669145, 29.613382899628, 29.899628252788, |
| 296 | 30.029739776952, 30.081784386617, 30.237918215613, 30.524163568773, |
| 297 | 32.918215613383, 32.996282527881, 34.42750929368, 34.609665427509, 35.0, |
| 298 | 35.417633410673, 36.113689095128, 36.160092807425, 36.5313225058, |
| 299 | 38.039443155452, 38.665893271462, 39.965197215777, 40.475638051044, |
| 300 | 42.053364269142, 42.865429234339, 43.584686774942, 47.366589327146, |
| 301 | 47.552204176334, 47.691415313225, 48.039443155452, 52.07656612529, |
| 302 | 53.584686774942, 55.0, 56.296691568837, 63.884738527215, 69.455709711846, |
| 303 | 80.261472785486, 82.854855923159, 87.801494130203, 95.389541088581, |
| 304 | 96.061899679829, 99.423692636073, 100.0, 100.0, 0.0, 7.0, 9.378640776699, |
| 305 | 10.669902912621, 12.572815533981, 13.52427184466, 14.0, 14.394941634241, |
| 306 | 15.647859922179, 16.083657587549, 16.546692607004, 16.655642023346, |
| 307 | 17.309338521401, 17.799610894942, 18.044747081712, 18.330739299611, |
| 308 | 18.426070038911, 18.630350194553, 18.929961089494, 19.215953307393, |
| 309 | 19.501945525292, 20.087548638132, 20.496108949416, 20.550583657588, |
| 310 | 20.645914396887, 21.0, 21.836956521739, 22.103260869565, 22.33152173913, |
| 311 | 22.902173913043, 23.396739130435, 23.586956521739, 23.663043478261, |
| 312 | 23.739130434783, 24.157608695652, 24.804347826087, 25.489130434783, |
| 313 | 26.516304347826, 28.0, 29.305555555556, 29.5, 29.75, 30.722222222222, |
| 314 | 31.472222222222, 31.777777777778, 31.916666666667, 31.972222222222, |
| 315 | 32.138888888889, 32.444444444444, 35.0, 35.073529411765, 36.421568627451, |
| 316 | 36.593137254902, 36.960784313725, 37.401960784314, 38.137254901961, |
| 317 | 38.186274509804, 38.578431372549, 40.171568627451, 40.833333333333, |
| 318 | 42.205882352941, 42.745098039216, 44.411764705882, 45.269607843137, |
| 319 | 46.029411764706, 50.024509803922, 50.220588235294, 50.367647058824, |
| 320 | 50.735294117647, 55.0, 57.720930232558, 60.274418604651, 61.404651162791, |
| 321 | 68.018604651163, 72.874418604651, 82.293023255814, 84.553488372093, |
| 322 | 88.86511627907, 95.479069767442, 96.06511627907, 98.995348837209, |
| 323 | 99.497674418605, 100.0, 0.0, 14.0, 14.419520547945, 14.647260273973, |
| 324 | 14.982876712329, 15.150684931507, 15.234589041096, 15.582191780822, |
| 325 | 16.684931506849, 17.068493150685, 17.47602739726, 17.571917808219, |
| 326 | 18.147260273973, 18.578767123288, 18.794520547945, 19.046232876712, |
| 327 | 19.130136986301, 19.309931506849, 19.573630136986, 19.825342465753, |
| 328 | 20.077054794521, 20.592465753425, 20.952054794521, 21.0, 21.324503311258, |
| 329 | 22.529801324503, 23.549668874172, 23.87417218543, 24.152317880795, |
| 330 | 24.847682119205, 25.450331125828, 25.682119205298, 25.774834437086, |
| 331 | 25.867549668874, 26.377483443709, 27.165562913907, 28.0, 28.913043478261, |
| 332 | 30.231884057971, 31.821256038647, 32.057971014493, 32.36231884058, |
| 333 | 33.545893719807, 34.458937198068, 34.830917874396, 35.0, 35.054200542005, |
| 334 | 35.216802168022, 35.514905149051, 38.008130081301, 38.089430894309, |
| 335 | 39.579945799458, 39.769647696477, 40.176151761518, 40.663956639566, |
| 336 | 41.476964769648, 41.531165311653, 41.964769647696, 43.726287262873, |
| 337 | 44.457994579946, 45.975609756098, 46.571815718157, 48.414634146341, |
| 338 | 49.363143631436, 50.20325203252, 54.620596205962, 54.837398373984, 55.0, |
| 339 | 55.583910034602, 62.357266435986, 64.887543252595, 67.262110726644, |
| 340 | 68.313148788927, 74.463667820069, 78.979238754325, 87.737889273356, |
| 341 | 89.839965397924, 93.849480968858, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 14.0, |
| 342 | 14.708092485549, 15.092485549133, 15.658959537572, 15.942196531792, |
| 343 | 16.083815028902, 16.670520231214, 18.531791907514, 19.179190751445, |
| 344 | 19.867052023121, 20.028901734104, 21.0, 21.739002932551, 22.108504398827, |
| 345 | 22.539589442815, 22.683284457478, 22.991202346041, 23.442815249267, |
| 346 | 23.873900293255, 24.304985337243, 25.187683284457, 25.803519061584, |
| 347 | 25.885630498534, 26.029325513196, 26.563049853372, 27.014662756598, |
| 348 | 27.158357771261, 27.281524926686, 27.589442815249, 27.856304985337, |
| 349 | 27.958944281525, 28.0, 28.083333333333, 28.541666666667, 29.25, 30.0, 31.125, |
| 350 | 32.75, 34.708333333333, 35.0, 35.291734197731, 36.426256077796, |
| 351 | 37.301458670989, 37.658022690438, 37.820097244733, 37.884927066451, |
| 352 | 38.079416531605, 38.435980551053, 41.418152350081, 41.515397082658, |
| 353 | 43.298217179903, 43.525121555916, 44.011345218801, 44.594813614263, |
| 354 | 45.567260940032, 45.63209076175, 46.150729335494, 48.257698541329, |
| 355 | 49.132901134522, 50.948136142626, 51.661264181523, 53.865478119935, 55.0, |
| 356 | 56.15671641791, 62.238805970149, 62.537313432836, 62.761194029851, |
| 357 | 63.320895522388, 69.813432835821, 72.238805970149, 74.514925373134, |
| 358 | 75.522388059701, 81.417910447761, 85.746268656716, 94.141791044776, |
| 359 | 96.15671641791, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 14.0, |
| 360 | 16.987804878049, 18.609756097561, 21.0, 21.175942549372, 21.263913824057, |
| 361 | 21.628366247756, 22.784560143627, 23.18671454219, 23.614003590664, |
| 362 | 23.714542190305, 24.317773788151, 24.770197486535, 24.996409335727, |
| 363 | 25.260323159785, 25.34829443447, 25.536804308797, 25.81328545781, |
| 364 | 26.077199281867, 26.341113105925, 26.881508078995, 27.258527827648, |
| 365 | 27.308797127469, 27.396768402154, 27.723518850987, 28.0, 28.39837398374, |
| 366 | 28.739837398374, 29.593495934959, 30.333333333333, 30.617886178862, |
| 367 | 30.731707317073, 30.845528455285, 31.471544715447, 32.439024390244, |
| 368 | 33.463414634146, 35.0, 36.553784860558, 38.426294820717, 38.705179282869, |
| 369 | 39.06374501992, 40.458167330677, 41.533864541833, 41.972111553785, |
| 370 | 42.171314741036, 42.250996015936, 42.490039840637, 42.92828685259, |
| 371 | 46.593625498008, 46.713147410359, 48.90438247012, 49.183266932271, |
| 372 | 49.780876494024, 50.498007968127, 51.693227091633, 51.772908366534, |
| 373 | 52.410358565737, 55.0, 55.966587112172, 57.971360381862, 58.758949880668, |
| 374 | 61.193317422434, 62.44630071599, 63.556085918854, 69.391408114558, |
| 375 | 69.677804295943, 69.892601431981, 70.429594272076, 76.658711217184, |
| 376 | 78.985680190931, 81.169451073986, 82.136038186158, 87.792362768496, |
| 377 | 91.945107398568, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, |
| 378 | 21.0, 21.414551607445, 21.639593908629, 21.971235194585, 22.137055837563, |
| 379 | 22.219966159052, 22.56345177665, 23.653130287648, 24.032148900169, |
| 380 | 24.434856175973, 24.529610829103, 25.098138747885, 25.524534686971, |
| 381 | 25.737732656514, 25.986463620981, 26.06937394247, 26.24703891709, |
| 382 | 26.507614213198, 26.756345177665, 27.005076142132, 27.514382402707, |
| 383 | 27.869712351946, 27.917089678511, 28.0, 30.394736842105, 32.421052631579, |
| 384 | 33.065789473684, 33.618421052632, 35.0, 35.668380462725, 35.925449871465, |
| 385 | 36.028277634961, 36.131105398458, 36.696658097686, 37.570694087404, |
| 386 | 38.496143958869, 39.884318766067, 41.889460154242, 44.305912596401, |
| 387 | 44.665809768638, 45.12853470437, 46.928020565553, 48.316195372751, |
| 388 | 48.881748071979, 49.13881748072, 49.241645244216, 49.550128534704, |
| 389 | 50.115681233933, 54.845758354756, 55.0, 57.201957295374, 57.482206405694, |
| 390 | 58.082740213523, 58.803380782918, 60.004448398577, 60.084519572954, |
| 391 | 60.725088967972, 63.327402135231, 64.408362989324, 66.650355871886, |
| 392 | 67.531138790036, 70.253558718861, 71.654804270463, 72.89590747331, |
| 393 | 79.421708185053, 79.741992882562, 79.982206405694, 80.582740213523, |
| 394 | 87.548932384342, 90.151245551601, 92.593416370107, 93.674377224199, 100.0, |
| 395 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 21.0, |
| 396 | 21.822147651007, 22.268456375839, 22.926174496644, 23.255033557047, |
| 397 | 23.419463087248, 24.10067114094, 26.261744966443, 27.013422818792, |
| 398 | 27.812080536913, 28.0, 29.191489361702, 30.085106382979, 30.531914893617, |
| 399 | 31.053191489362, 31.22695035461, 31.599290780142, 32.145390070922, |
| 400 | 32.666666666667, 33.187943262411, 34.255319148936, 35.0, 35.298507462687, |
| 401 | 35.820895522388, 37.761194029851, 39.402985074627, 39.925373134328, |
| 402 | 40.373134328358, 41.492537313433, 42.462686567164, 42.835820895522, |
| 403 | 42.985074626866, 43.134328358209, 43.955223880597, 45.223880597015, |
| 404 | 46.567164179104, 48.582089552239, 51.492537313433, 55.0, 55.381355932203, |
| 405 | 55.871670702179, 57.778450363196, 59.249394673123, 59.848668280872, |
| 406 | 60.121065375303, 60.230024213075, 60.556900726392, 61.15617433414, |
| 407 | 66.168280871671, 66.331719128329, 69.32808716707, 69.709443099274, |
| 408 | 70.526634382567, 71.507263922518, 73.141646489104, 73.250605326877, |
| 409 | 74.122276029056, 77.663438256659, 79.134382566586, 82.185230024213, |
| 410 | 83.383777239709, 87.088377723971, 88.995157384988, 90.68401937046, |
| 411 | 99.56416464891, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 412 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 21.0, 28.0, |
| 413 | 28.383285302594, 28.948126801153, 29.230547550432, 29.371757925072, |
| 414 | 29.956772334294, 31.812680115274, 32.458213256484, 33.14409221902, |
| 415 | 33.305475504323, 34.273775216138, 35.0, 36.333333333333, 37.888888888889, |
| 416 | 38.407407407407, 39.518518518519, 41.148148148148, 42.703703703704, |
| 417 | 44.259259259259, 47.444444444444, 49.666666666667, 49.962962962963, |
| 418 | 50.481481481481, 52.407407407407, 54.037037037037, 54.555555555556, 55.0, |
| 419 | 55.941422594142, 56.757322175732, 57.071129707113, 57.196652719665, |
| 420 | 57.322175732218, 58.012552301255, 59.07949790795, 60.20920502092, |
| 421 | 61.903765690377, 64.351464435146, 67.301255230126, 67.740585774059, |
| 422 | 68.305439330544, 70.502092050209, 72.196652719665, 72.887029288703, |
| 423 | 73.200836820084, 73.326359832636, 73.702928870293, 74.393305439331, |
| 424 | 80.167364016736, 80.355648535565, 83.807531380753, 84.246861924686, |
| 425 | 85.188284518828, 86.317991631799, 88.200836820084, 88.326359832636, |
| 426 | 89.330543933054, 93.410041841004, 95.10460251046, 98.619246861925, 100.0, |
| 427 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 428 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, |
| 429 | 28.0, 28.95703125, 29.4765625, 30.2421875, 30.625, 30.81640625, 31.609375, |
| 430 | 34.125, 35.0, 37.098765432099, 37.592592592593, 40.555555555556, |
| 431 | 42.777777777778, 43.888888888889, 45.185185185185, 45.617283950617, |
| 432 | 46.543209876543, 47.901234567901, 49.197530864198, 50.493827160494, |
| 433 | 53.148148148148, 55.0, 55.234680573664, 55.645371577575, 57.170795306389, |
| 434 | 58.461538461538, 58.87222946545, 59.224250325945, 60.104302477184, |
| 435 | 60.867014341591, 61.16036505867, 61.277705345502, 61.395045632334, |
| 436 | 62.040417209909, 63.037809647979, 64.093872229465, 65.677966101695, |
| 437 | 67.966101694915, 70.723598435463, 71.134289439374, 71.662320730117, |
| 438 | 73.715775749674, 75.299869621904, 75.945241199478, 76.238591916558, |
| 439 | 76.35593220339, 76.707953063885, 77.35332464146, 82.750977835724, |
| 440 | 82.926988265971, 86.153846153846, 86.564537157757, 87.444589308996, |
| 441 | 88.500651890482, 90.26075619296, 90.378096479791, 91.316818774446, |
| 442 | 95.13037809648, 96.714471968709, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 443 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 444 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 445 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 446 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 447 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 448 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 449 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 450 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 451 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 452 | 100.0 } ; /* Variable: APTC_TRQ_PED_INV_MAP_PED_POS_MPV |
| 453 | * Referenced by: '<S85>/2D_Lookup_Table' |
| 454 | */ |
| 455 | |
| 456 | real_T APTC_TRQ_PED_INV_MAP_TRQ_STEPS[83] = { 0.0, 20.0, 55.0, 74.0, 102.0, |
| 457 | 116.0, 123.0, 152.0, 244.0, 276.0, 310.0, 318.0, 366.0, 402.0, 420.0, 441.0, |
| 458 | 448.0, 463.0, 485.0, 506.0, 527.0, 570.0, 600.0, 604.0, 611.0, 637.0, 659.0, |
| 459 | 666.0, 672.0, 687.0, 700.0, 705.0, 707.0, 709.0, 720.0, 737.0, 755.0, 782.0, |
| 460 | 821.0, 868.0, 875.0, 884.0, 919.0, 946.0, 957.0, 962.0, 964.0, 970.0, 981.0, |
| 461 | 1073.0, 1076.0, 1131.0, 1138.0, 1153.0, 1171.0, 1201.0, 1203.0, 1219.0, 1284.0, |
| 462 | 1311.0, 1367.0, 1389.0, 1457.0, 1492.0, 1523.0, 1686.0, 1694.0, 1700.0, 1715.0, |
| 463 | 1889.0, 1954.0, 2015.0, 2042.0, 2200.0, 2316.0, 2541.0, 2595.0, 2698.0, 2856.0, |
| 464 | 2870.0, 2940.0, 2952.0, 2964.0 } ; /* Variable: APTC_TRQ_PED_INV_MAP_TRQ_STEPS |
| 465 | * Referenced by: '<S85>/2D_Lookup_Table' |
| 466 | */ |
| 467 | |
| 468 | real_T APTC_TRQ_PED_TRQ_DATA_MPV[128] = { 0.0, 448.0, 570.0, 737.0, 981.0, |
| 469 | 1138.0, 1311.0, 1457.0, 0.0, 420.0, 527.0, 720.0, 970.0, 1131.0, 1311.0, |
| 470 | 1715.0, 0.0, 244.0, 506.0, 700.0, 964.0, 1171.0, 1523.0, 2316.0, 0.0, 152.0, |
| 471 | 485.0, 709.0, 957.0, 1201.0, 1686.0, 2595.0, 0.0, 116.0, 463.0, 720.0, 946.0, |
| 472 | 1219.0, 1954.0, 2870.0, 0.0, 74.0, 441.0, 705.0, 919.0, 1203.0, 2042.0, 2940.0, |
| 473 | 0.0, 20.0, 310.0, 666.0, 884.0, 1153.0, 2015.0, 2952.0, 0.0, 20.0, 123.0, |
| 474 | 637.0, 821.0, 1073.0, 1889.0, 2964.0, 0.0, 20.0, 20.0, 604.0, 755.0, 962.0, |
| 475 | 1700.0, 2856.0, 0.0, 20.0, 20.0, 366.0, 707.0, 875.0, 1492.0, 2698.0, 0.0, |
| 476 | 20.0, 20.0, 102.0, 659.0, 782.0, 1284.0, 2541.0, 0.0, 20.0, 20.0, 20.0, 611.0, |
| 477 | 687.0, 1076.0, 2200.0, 0.0, 20.0, 20.0, 20.0, 318.0, 600.0, 868.0, 1694.0, 0.0, |
| 478 | 20.0, 20.0, 20.0, 55.0, 402.0, 672.0, 1389.0, 0.0, 20.0, 20.0, 20.0, 20.0, |
| 479 | 276.0, 600.0, 1367.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } ;/* Variable: APTC_TRQ_PED_TRQ_DATA_MPV |
| 480 | * Referenced by: '<S83>/2-D Lookup Table' |
| 481 | */ |
| 482 | |
| 483 | real_T APTC_TRQ_PED_TRQ_ESPD_STEP_MPV[16] = { 500.0, 650.0, 885.0, 950.0, 1050.0, |
| 484 | 1120.0, 1240.0, 1360.0, 1475.0, 1590.0, 1710.0, 1830.0, 1950.0, 2150.0, 2300.0, |
| 485 | 2350.0 } ; /* Variable: APTC_TRQ_PED_TRQ_ESPD_STEP_MPV |
| 486 | * Referenced by: |
| 487 | * '<S83>/2-D Lookup Table' |
| 488 | * '<S85>/2D_Lookup_Table' |
| 489 | */ |
| 490 | |
| 491 | real_T APTC_TRQ_PED_TRQ_POS_STEP_MPV[8] = { 0.0, 7.0, 14.0, 21.0, 28.0, 35.0, |
| 492 | 55.0, 100.0 } ; /* Variable: APTC_TRQ_PED_TRQ_POS_STEP_MPV |
| 493 | * Referenced by: '<S83>/2-D Lookup Table' |
| 494 | */ |
| 495 | |
| 496 | real_T BRK_DEM_KD_DATA_MPV[8] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } ;/* Variable: BRK_DEM_KD_DATA_MPV |
| 497 | * Referenced by: '<S149>/1D_Lookup_Table' |
| 498 | */ |
| 499 | |
| 500 | real_T BRK_DEM_KI_DATA_MPV[8] = { -1.5, -1.5, -1.5, -1.5, -1.5, -1.5, -1.5, -1.5 |
| 501 | } ; /* Variable: BRK_DEM_KI_DATA_MPV |
| 502 | * Referenced by: '<S148>/1D_Lookup_Table' |
| 503 | */ |
| 504 | |
| 505 | real_T BRK_DEM_KP_DATA_MPV[8] = { -4.0, -4.0, -4.0, -4.0, -4.0, -4.0, -4.0, -4.0 |
| 506 | } ; /* Variable: BRK_DEM_KP_DATA_MPV |
| 507 | * Referenced by: '<S147>/1D_Lookup_Table' |
| 508 | */ |
| 509 | |
| 510 | real_T BRK_DEM_MASS_STEP_MPV[8] = { 0.0, 5000.0, 10000.0, 20000.0, 30000.0, |
| 511 | 40000.0, 50000.0, 54000.0 } ; /* Variable: BRK_DEM_MASS_STEP_MPV |
| 512 | * Referenced by: |
| 513 | * '<S147>/1D_Lookup_Table' |
| 514 | * '<S148>/1D_Lookup_Table' |
| 515 | * '<S149>/1D_Lookup_Table' |
| 516 | */ |
| 517 | |
| 518 | real_T BRK_GOV_FF_DECEL_RATE_DATA_MPV[32] = { 0.0, -0.39, -1.76, -3.13, -4.5, |
| 519 | -5.87, -7.24, -8.61, -9.98, -11.35, -12.72, -14.09, -15.46, -16.83, -18.2, |
| 520 | -19.57, 0.0, -0.12, -0.53, -0.94, -1.35, -1.76, -2.17, -2.58, -2.99, -3.41, |
| 521 | -3.82, -4.23, -4.64, -5.05, -5.46, -5.87 } ;/* Variable: BRK_GOV_FF_DECEL_RATE_DATA_MPV |
| 522 | * Referenced by: '<S199>/2D_Lookup_Table' |
| 523 | */ |
| 524 | |
| 525 | real_T BRK_GOV_FF_DECEL_RATE_STEP_MPV[16] = { -19.57, -18.2, -16.83, -15.46, |
| 526 | -14.09, -12.72, -11.35, -9.98, -8.61, -7.24, -5.87, -4.5, -3.13, -1.76, -0.39, |
| 527 | 0.0 } ; /* Variable: BRK_GOV_FF_DECEL_RATE_STEP_MPV |
| 528 | * Referenced by: |
| 529 | * '<S200>/2D_Lookup_Table' |
| 530 | * '<S201>/2D_Lookup_Table' |
| 531 | */ |
| 532 | |
| 533 | real_T BRK_GOV_FF_MASS_STEP_MPV[2] = { 9035.0, 36287.0 } ;/* Variable: BRK_GOV_FF_MASS_STEP_MPV |
| 534 | * Referenced by: |
| 535 | * '<S199>/2D_Lookup_Table' |
| 536 | * '<S200>/2D_Lookup_Table' |
| 537 | * '<S201>/2D_Lookup_Table' |
| 538 | */ |
| 539 | |
| 540 | real_T BRK_GOV_FF_PRESS_KPA_DATA_MPV[32] = { 1034.0, 965.0, 896.0, 827.0, 758.0, |
| 541 | 689.0, 621.0, 552.0, 483.0, 414.0, 345.0, 276.0, 207.0, 138.0, 69.0, 0.0, |
| 542 | 2585.0, 2413.0, 2240.0, 2068.0, 1895.0, 1723.0, 1553.0, 1380.0, 1208.0, 1035.0, |
| 543 | 863.0, 690.0, 518.0, 345.0, 173.0, 0.0 } ;/* Variable: BRK_GOV_FF_PRESS_KPA_DATA_MPV |
| 544 | * Referenced by: |
| 545 | * '<S200>/2D_Lookup_Table' |
| 546 | * '<S201>/2D_Lookup_Table' |
| 547 | */ |
| 548 | |
| 549 | real_T BRK_GOV_FF_PRESS_KPA_STEP_MPV[16] = { 0.0, 69.0, 138.0, 207.0, 276.0, |
| 550 | 345.0, 414.0, 483.0, 552.0, 621.0, 689.0, 758.0, 827.0, 896.0, 965.0, 1034.0 } |
| 551 | ; /* Variable: BRK_GOV_FF_PRESS_KPA_STEP_MPV |
| 552 | * Referenced by: '<S199>/2D_Lookup_Table' |
| 553 | */ |
| 554 | |
| 555 | real_T DISTANCE_M = 200.0; /* Variable: DISTANCE_M |
| 556 | * Referenced by: '<S81>/DISTANCE_M' |
| 557 | */ |
| 558 | real_T Lateral_Control_Curvature_Limit = 0.5;/* Variable: Lateral_Control_Curvature_Limit |
| 559 | * Referenced by: |
| 560 | * '<S281>/Constant3' |
| 561 | * '<S281>/Constant5' |
| 562 | */ |
| 563 | real_T Lateral_Control_D = 0.07; /* Variable: Lateral_Control_D |
| 564 | * Referenced by: '<S313>/Derivative Gain' |
| 565 | */ |
| 566 | real_T Lateral_Control_Error_Limit = 0.1;/* Variable: Lateral_Control_Error_Limit |
| 567 | * Referenced by: |
| 568 | * '<S280>/Error Saturation' |
| 569 | * '<S281>/Constant' |
| 570 | * '<S281>/Constant1' |
| 571 | */ |
| 572 | real_T Lateral_Control_Error_Rate_Limit = 0.04;/* Variable: Lateral_Control_Error_Rate_Limit |
| 573 | * Referenced by: |
| 574 | * '<S281>/Constant10' |
| 575 | * '<S281>/Constant7' |
| 576 | * '<S281>/Constant8' |
| 577 | * '<S281>/Constant9' |
| 578 | */ |
| 579 | real_T Lateral_Control_I = 0.0; /* Variable: Lateral_Control_I |
| 580 | * Referenced by: '<S313>/Integral Gain' |
| 581 | */ |
| 582 | real_T Lateral_Control_P = 0.6; /* Variable: Lateral_Control_P |
| 583 | * Referenced by: |
| 584 | * '<S281>/PGain' |
| 585 | * '<S313>/Proportional Gain' |
| 586 | */ |
| 587 | real_T Lateral_Control_Pole = 0.98; /* Variable: Lateral_Control_Pole |
| 588 | * Referenced by: '<S317>/GainPole' |
| 589 | */ |
| 590 | real_T Lateral_Control_Rate_Limit_APV = 0.04;/* Variable: Lateral_Control_Rate_Limit_APV |
| 591 | * Referenced by: |
| 592 | * '<S301>/Constant' |
| 593 | * '<S316>/Constant' |
| 594 | */ |
| 595 | real_T Lateral_Control_YawRate_Limit = 1.0;/* Variable: Lateral_Control_YawRate_Limit |
| 596 | * Referenced by: |
| 597 | * '<S281>/Constant2' |
| 598 | * '<S281>/Constant4' |
| 599 | */ |
| 600 | real_T Lateral_Control_Zero = 0.99; /* Variable: Lateral_Control_Zero |
| 601 | * Referenced by: '<S317>/GainZero' |
| 602 | */ |
| 603 | real_T PROPB_REAX_1_E4_DESIRED_POSITION_APV = 0.0;/* Variable: PROPB_REAX_1_E4_DESIRED_POSITION_APV |
| 604 | * Referenced by: '<S1000>/Constant7' |
| 605 | */ |
| 606 | real_T REAX_OFFSET_APV = 0.0; /* Variable: REAX_OFFSET_APV |
| 607 | * Referenced by: |
| 608 | * '<S80>/Constant' |
| 609 | * '<S280>/ReAX Offset' |
| 610 | * '<S281>/Constant6' |
| 611 | */ |
| 612 | real_T STANLEY_GAIN_APV = 0.55; /* Variable: STANLEY_GAIN_APV |
| 613 | * Referenced by: '<S280>/Stanley Gain K' |
| 614 | */ |
| 615 | real_T STANLEY_GAIN_KDSTEER_APV = 0.18;/* Variable: STANLEY_GAIN_KDSTEER_APV |
| 616 | * Referenced by: '<S280>/Stanley Gain Kdsteer' |
| 617 | */ |
| 618 | real_T STANLEY_GAIN_KDYAW_APV = -0.35; /* Variable: STANLEY_GAIN_KDYAW_APV |
| 619 | * Referenced by: '<S280>/Stanley Gain Kdyaw' |
| 620 | */ |
| 621 | real_T STANLEY_GAIN_KSOFT_APV = 0.0; /* Variable: STANLEY_GAIN_KSOFT_APV |
| 622 | * Referenced by: '<S280>/Stanley Gain Ksoft' |
| 623 | */ |
| 624 | real_T STEERCTRL_WHEEL_ANGLE_DATA_MPV[72] = { -800.02001953125, -780.02899169922, |
| 625 | -760.03399658203, -740.0, -720.0, -700.00402832031, -680.0, -660.01397705078, |
| 626 | -640.01898193359, -620.02398681641, -600.02001953125, -580.03399658203, |
| 627 | -560.03900146484, -540.0, -520.00402832031, -500.00900268555, -480.01400756836, |
| 628 | -460.01901245117, -440.02398681641, -420.01998901367, -400.03399658203, |
| 629 | -380.03900146484, -360.0, -340.00399780273, -320.00900268555, -300.01400756836, |
| 630 | -280.01901245117, -260.02398681641, -240.02900695801, -220.03399658203, |
| 631 | -200.03900146484, -180.0, -160.00399780273, -140.00900268555, -120.01399993896, |
| 632 | -100.01899719238, -80.024002075195, -60.028999328613, -40.034000396729, |
| 633 | 0.52700001001358, 29.969999313354, 50.00899887085, 69.959999084473, |
| 634 | 89.949996948242, 109.99500274658, 129.99000549316, 149.98500061035, |
| 635 | 170.0240020752, 189.97500610352, 209.9700012207, 229.96499633789, |
| 636 | 249.96000671387, 270.0, 289.99499511719, 309.98999023438, 329.98498535156, |
| 637 | 349.98001098633, 369.97500610352, 390.01400756836, 410.00900268555, 450.0, |
| 638 | 470.0299987793, 489.98999023438, 509.98498535156, 529.97998046875, |
| 639 | 549.97497558594, 569.96997070313, 589.96502685547, 610.21997070313, 630.0, |
| 640 | 650.25, 670.0 } ; /* Variable: STEERCTRL_WHEEL_ANGLE_DATA_MPV |
| 641 | * Referenced by: '<S276>/1D_Lookup_Table' |
| 642 | */ |
| 643 | |
| 644 | real_T STEERCTRL_WHEEL_ANGLE_STEP_MPV[72] = { -46.0, -44.5, -43.0, -42.0, -40.0, |
| 645 | -39.0, -37.5, -36.5, -35.0, -34.0, -33.0, -31.5, -30.5, -29.0, -28.0, -26.5, |
| 646 | -25.5, -24.5, -23.5, -22.0, -21.0, -20.0, -19.0, -17.5, -16.5, -15.5, -14.0, |
| 647 | -13.0, -12.0, -11.0, -10.0, -8.5, -7.5, -6.5, -5.0, -4.0, -3.0, -2.0, -1.0, |
| 648 | 0.0, 1.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, |
| 649 | 15.0, 16.0, 17.0, 18.5, 19.5, 20.5, 21.5, 23.5, 24.5, 25.5, 26.5, 27.5, 28.5, |
| 650 | 29.0, 30.0, 31.0, 31.5, 32.5, 33.0 } ;/* Variable: STEERCTRL_WHEEL_ANGLE_STEP_MPV |
| 651 | * Referenced by: '<S276>/1D_Lookup_Table' |
| 652 | */ |
| 653 | |
| 654 | real_T TQ_DEM_GEAR_RATIO_STEP_MPV[8] = { 0.0, 0.2, 4.0, 8.0, 10.0, 16.0, 18.0, |
| 655 | 20.0 } ; /* Variable: TQ_DEM_GEAR_RATIO_STEP_MPV |
| 656 | * Referenced by: |
| 657 | * '<S241>/2D_Lookup_Table' |
| 658 | * '<S242>/2D_Lookup_Table' |
| 659 | * '<S243>/2D_Lookup_Table' |
| 660 | */ |
| 661 | |
| 662 | real_T TQ_DEM_KD_DATA_MPV[64] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, |
| 663 | 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, |
| 664 | 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, |
| 665 | 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, |
| 666 | 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } ;/* Variable: TQ_DEM_KD_DATA_MPV |
| 667 | * Referenced by: '<S243>/2D_Lookup_Table' |
| 668 | */ |
| 669 | |
| 670 | real_T TQ_DEM_KI_DATA_MPV[64] = { 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, |
| 671 | 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, |
| 672 | 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, |
| 673 | 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, |
| 674 | 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7 } ;/* Variable: TQ_DEM_KI_DATA_MPV |
| 675 | * Referenced by: '<S242>/2D_Lookup_Table' |
| 676 | */ |
| 677 | |
| 678 | real_T TQ_DEM_KP_DATA_MPV[64] = { 4.0, 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, |
| 679 | 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, |
| 680 | 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, |
| 681 | 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, |
| 682 | 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0 } ;/* Variable: TQ_DEM_KP_DATA_MPV |
| 683 | * Referenced by: '<S241>/2D_Lookup_Table' |
| 684 | */ |
| 685 | |
| 686 | real_T TQ_DEM_MASS_STEP_MPV[8] = { 0.0, 5000.0, 10000.0, 20000.0, 30000.0, |
| 687 | 40000.0, 50000.0, 54000.0 } ; /* Variable: TQ_DEM_MASS_STEP_MPV |
| 688 | * Referenced by: |
| 689 | * '<S241>/2D_Lookup_Table' |
| 690 | * '<S242>/2D_Lookup_Table' |
| 691 | * '<S243>/2D_Lookup_Table' |
| 692 | */ |
| 693 | |
| 694 | real_T UndersteerCorection = 0.18; /* Variable: UndersteerCorection |
| 695 | * Referenced by: |
| 696 | * '<S280>/Understeer Corection' |
| 697 | * '<S281>/Understeer Corection' |
| 698 | */ |
| 699 | real_T VSPD_TARGET_KPH_APV = 0.0; /* Variable: VSPD_TARGET_KPH_APV |
| 700 | * Referenced by: '<S81>/VSPD_TARGET_KPH_APV' |
| 701 | */ |
| 702 | real_T YAW_RATE_OFFSET_APV = -0.0066; /* Variable: YAW_RATE_OFFSET_APV |
| 703 | * Referenced by: |
| 704 | * '<S280>/YAW_RATE_OFFSET_APV' |
| 705 | * '<S281>/YAW_RATE_OFFSET_APV' |
| 706 | */ |
| 707 | real_T Yaw_Rate_FF_Gain = 0.2; /* Variable: Yaw_Rate_FF_Gain |
| 708 | * Referenced by: '<S281>/RateFeedbackGain' |
| 709 | */ |
| 710 | ENUM_AUTONOMOUS_MODE_T AUTONOMOUS_MODE_SELECTOR_APV = |
| 711 | ENUM_AUTONOMOUS_MODE_T_AUTO; /* Variable: AUTONOMOUS_MODE_SELECTOR_APV |
| 712 | * Referenced by: '<S76>/AUTONOMOUS_MODE_SELECTOR_APV' |
| 713 | */ |
| 714 | ENUM_CAN_RX_T CANR_PROPB_XPR_1_50_CHANNEL_APV = ENUM_CAN_RX_T_RX_CAN_3;/* Variable: CANR_PROPB_XPR_1_50_CHANNEL_APV |
| 715 | * Referenced by: '<S452>/Constant' |
| 716 | */ |
| 717 | ENUM_CAN_RX_T PROPB_REAX_CHANNEL_APV = ENUM_CAN_RX_T_RX_CAN_2;/* Variable: PROPB_REAX_CHANNEL_APV |
| 718 | * Referenced by: |
| 719 | * '<S450>/Constant' |
| 720 | * '<S451>/Constant' |
| 721 | * '<S472>/Constant3' |
| 722 | */ |
| 723 | ENUM_LAT_STEER_SOURCE_T LAT_STEER_SRC_SELECTOR_APV = |
| 724 | ENUM_LAT_STEER_SOURCE_T_PIC_STANLEY; /* Variable: LAT_STEER_SRC_SELECTOR_APV |
| 725 | * Referenced by: '<S80>/LAT_STEER_SRC_SELECTOR_APV' |
| 726 | */ |
| 727 | ENUM_LONG_SPEED_DEMAND_SOURCE_T LONG_SPEED_SRC_SELECTOR_APV = |
| 728 | ENUM_LONG_SPEED_DEMAND_SOURCE_T_WAYPOINTS;/* Variable: LONG_SPEED_SRC_SELECTOR_APV |
| 729 | * Referenced by: |
| 730 | * '<S80>/LONG_SPEED_SRC_SELECTOR_APV' |
| 731 | * '<S81>/LONG_SPEED_SRC_SELECTOR_APV' |
| 732 | */ |
| 733 | ENUM_REAX_OPERATION_MODE_T PROPB_REAX_1_E4_DESIRED_OPMODE_APV = |
| 734 | ENUM_REAX_OPERATION_MODE_T_POSITION_CTRL_MODE;/* Variable: PROPB_REAX_1_E4_DESIRED_OPMODE_APV |
| 735 | * Referenced by: '<S983>/Constant6' |
| 736 | */ |
| 737 | ENUM_STEERING_POS_SIGNAL_SOURCE_T PROPB_REAX_1_E4_DES_POS_SIG_SRC_APV = |
| 738 | ENUM_STEERING_POS_SIGNAL_SOURCE_T_ESTIMATION;/* Variable: PROPB_REAX_1_E4_DES_POS_SIG_SRC_APV |
| 739 | * Referenced by: '<S1000>/Constant1' |
| 740 | */ |
| 741 | ENUM_SWITCH_T LATERAL_GAIN_SCHEDULE_APV = ENUM_SWITCH_T_ON;/* Variable: LATERAL_GAIN_SCHEDULE_APV |
| 742 | * Referenced by: |
| 743 | * '<S280>/Use Gain Schedule' |
| 744 | * '<S280>/Use Gain Schedule1' |
| 745 | * '<S281>/Use Gain Schedule' |
| 746 | * '<S301>/Use Gain Schedule' |
| 747 | */ |
| 748 | ENUM_SWITCH_T RATE_LIMITER_ENABLE_APV = ENUM_SWITCH_T_ON;/* Variable: RATE_LIMITER_ENABLE_APV |
| 749 | * Referenced by: |
| 750 | * '<S301>/RATE_LIMITER_ENABLE_APV' |
| 751 | * '<S316>/RATE_LIMITER_ENABLE_APV' |
| 752 | */ |
| 753 | |
| 754 | /* Block signals (default storage) */ |
| 755 | B_L4_MABX_T L4_MABX_B; |
| 756 | |
| 757 | /* Block states (default storage) */ |
| 758 | DW_L4_MABX_T L4_MABX_DW; |
| 759 | |
| 760 | /* Previous zero-crossings (trigger) states */ |
| 761 | PrevZCX_L4_MABX_T L4_MABX_PrevZCX; |
| 762 | |
| 763 | /* Real-time model */ |
| 764 | RT_MODEL_L4_MABX_T L4_MABX_M_; |
| 765 | RT_MODEL_L4_MABX_T *const L4_MABX_M = &L4_MABX_M_; |
| 766 | |
| 767 | /* Forward declaration for local functions */ |
| 768 | static int32_T safe_cast_to_ENUM_XPR_CONTROL_M(int32_T input); |
| 769 | static int32_T safe_cast_to_ENUM_XPR_ERROR_STA(int32_T input); |
| 770 | static void L4_MABX_enter_atomic_INITIAL(void); |
| 771 | static void L4_MABX_Calculate_abc(void); |
| 772 | static void L4_MABX_CalculateAlternate_abc(void); |
| 773 | static void L4_MABX_CalculateAcceleration34(void); |
| 774 | static int32_T safe_cast_to_ENUM_CAN_STATUS_DI(int32_T input); |
| 775 | |
| 776 | /* Lookup Binary Search Utility BINARYSEARCH_real_T */ |
| 777 | void BINARYSEARCH_real_T(uint32_T *piLeft, uint32_T *piRght, real_T u, const |
| 778 | real_T *pData, uint32_T iHi) |
| 779 | { |
| 780 | /* Find the location of current input value in the data table. */ |
| 781 | *piLeft = 0U; |
| 782 | *piRght = iHi; |
| 783 | if (u <= pData[0] ) { |
| 784 | /* Less than or equal to the smallest point in the table. */ |
| 785 | *piRght = 0U; |
| 786 | } else if (u >= pData[iHi] ) { |
| 787 | /* Greater than or equal to the largest point in the table. */ |
| 788 | *piLeft = iHi; |
| 789 | } else { |
| 790 | uint32_T i; |
| 791 | |
| 792 | /* Do a binary search. */ |
| 793 | while (( *piRght - *piLeft ) > 1U ) { |
| 794 | /* Get the average of the left and right indices using to Floor rounding. */ |
| 795 | i = (*piLeft + *piRght) >> 1; |
| 796 | |
| 797 | /* Move either the right index or the left index so that */ |
| 798 | /* LeftDataPoint <= CurrentValue < RightDataPoint */ |
| 799 | if (u < pData[i] ) { |
| 800 | *piRght = i; |
| 801 | } else { |
| 802 | *piLeft = i; |
| 803 | } |
| 804 | } |
| 805 | } |
| 806 | } |
| 807 | |
| 808 | /* Lookup Utility LookUp_real_T_real_T */ |
| 809 | void LookUp_real_T_real_T(real_T *pY, const real_T *pYData, real_T u, const |
| 810 | real_T *pUData, uint32_T iHi) |
| 811 | { |
| 812 | uint32_T iLeft; |
| 813 | uint32_T iRght; |
| 814 | BINARYSEARCH_real_T( &(iLeft), &(iRght), u, pUData, iHi); |
| 815 | |
| 816 | { |
| 817 | real_T lambda; |
| 818 | if (pUData[iRght] > pUData[iLeft] ) { |
| 819 | real_T num; |
| 820 | real_T den; |
| 821 | den = pUData[iRght]; |
| 822 | den -= pUData[iLeft]; |
| 823 | num = u; |
| 824 | num -= pUData[iLeft]; |
| 825 | lambda = num / den; |
| 826 | } else { |
| 827 | lambda = 0.0; |
| 828 | } |
| 829 | |
| 830 | { |
| 831 | real_T yLeftCast; |
| 832 | real_T yRghtCast; |
| 833 | yLeftCast = pYData[iLeft]; |
| 834 | yRghtCast = pYData[iRght]; |
| 835 | yLeftCast += lambda * ( yRghtCast - yLeftCast ); |
| 836 | (*pY) = yLeftCast; |
| 837 | } |
| 838 | } |
| 839 | } |
| 840 | |
| 841 | real_T look1_binlcapw(real_T u0, const real_T bp0[], const real_T table[], |
| 842 | uint32_T maxIndex) |
| 843 | { |
| 844 | real_T y; |
| 845 | real_T frac; |
| 846 | uint32_T iRght; |
| 847 | uint32_T iLeft; |
| 848 | uint32_T bpIdx; |
| 849 | |
| 850 | /* Lookup 1-D |
| 851 | Search method: 'binary' |
| 852 | Use previous index: 'off' |
| 853 | Interpolation method: 'Linear point-slope' |
| 854 | Extrapolation method: 'Clip' |
| 855 | Use last breakpoint for index at or above upper limit: 'on' |
| 856 | Remove protection against out-of-range input in generated code: 'off' |
| 857 | */ |
| 858 | /* Prelookup - Index and Fraction |
| 859 | Index Search method: 'binary' |
| 860 | Extrapolation method: 'Clip' |
| 861 | Use previous index: 'off' |
| 862 | Use last breakpoint for index at or above upper limit: 'on' |
| 863 | Remove protection against out-of-range input in generated code: 'off' |
| 864 | */ |
| 865 | if (u0 <= bp0[0U]) { |
| 866 | iLeft = 0U; |
| 867 | frac = 0.0; |
| 868 | } else if (u0 < bp0[maxIndex]) { |
| 869 | /* Binary Search */ |
| 870 | bpIdx = maxIndex >> 1U; |
| 871 | iLeft = 0U; |
| 872 | iRght = maxIndex; |
| 873 | while (iRght - iLeft > 1U) { |
| 874 | if (u0 < bp0[bpIdx]) { |
| 875 | iRght = bpIdx; |
| 876 | } else { |
| 877 | iLeft = bpIdx; |
| 878 | } |
| 879 | |
| 880 | bpIdx = (iRght + iLeft) >> 1U; |
| 881 | } |
| 882 | |
| 883 | frac = (u0 - bp0[iLeft]) / (bp0[iLeft + 1U] - bp0[iLeft]); |
| 884 | } else { |
| 885 | iLeft = maxIndex; |
| 886 | frac = 0.0; |
| 887 | } |
| 888 | |
| 889 | /* Interpolation 1-D |
| 890 | Interpolation method: 'Linear point-slope' |
| 891 | Use last breakpoint for index at or above upper limit: 'on' |
| 892 | Overflow mode: 'portable wrapping' |
| 893 | */ |
| 894 | if (iLeft == maxIndex) { |
| 895 | y = table[iLeft]; |
| 896 | } else { |
| 897 | y = (table[iLeft + 1U] - table[iLeft]) * frac + table[iLeft]; |
| 898 | } |
| 899 | |
| 900 | return y; |
| 901 | } |
| 902 | |
| 903 | real_T look2_binlcapw(real_T u0, real_T u1, const real_T bp0[], const real_T |
| 904 | bp1[], const real_T table[], const uint32_T maxIndex[], |
| 905 | uint32_T stride) |
| 906 | { |
| 907 | real_T y; |
| 908 | real_T frac; |
| 909 | uint32_T bpIndices[2]; |
| 910 | real_T fractions[2]; |
| 911 | real_T yR_1d; |
| 912 | uint32_T iRght; |
| 913 | uint32_T bpIdx; |
| 914 | uint32_T iLeft; |
| 915 | |
| 916 | /* Lookup 2-D |
| 917 | Search method: 'binary' |
| 918 | Use previous index: 'off' |
| 919 | Interpolation method: 'Linear point-slope' |
| 920 | Extrapolation method: 'Clip' |
| 921 | Use last breakpoint for index at or above upper limit: 'on' |
| 922 | Remove protection against out-of-range input in generated code: 'off' |
| 923 | */ |
| 924 | /* Prelookup - Index and Fraction |
| 925 | Index Search method: 'binary' |
| 926 | Extrapolation method: 'Clip' |
| 927 | Use previous index: 'off' |
| 928 | Use last breakpoint for index at or above upper limit: 'on' |
| 929 | Remove protection against out-of-range input in generated code: 'off' |
| 930 | */ |
| 931 | if (u0 <= bp0[0U]) { |
| 932 | iLeft = 0U; |
| 933 | frac = 0.0; |
| 934 | } else if (u0 < bp0[maxIndex[0U]]) { |
| 935 | /* Binary Search */ |
| 936 | bpIdx = maxIndex[0U] >> 1U; |
| 937 | iLeft = 0U; |
| 938 | iRght = maxIndex[0U]; |
| 939 | while (iRght - iLeft > 1U) { |
| 940 | if (u0 < bp0[bpIdx]) { |
| 941 | iRght = bpIdx; |
| 942 | } else { |
| 943 | iLeft = bpIdx; |
| 944 | } |
| 945 | |
| 946 | bpIdx = (iRght + iLeft) >> 1U; |
| 947 | } |
| 948 | |
| 949 | frac = (u0 - bp0[iLeft]) / (bp0[iLeft + 1U] - bp0[iLeft]); |
| 950 | } else { |
| 951 | iLeft = maxIndex[0U]; |
| 952 | frac = 0.0; |
| 953 | } |
| 954 | |
| 955 | fractions[0U] = frac; |
| 956 | bpIndices[0U] = iLeft; |
| 957 | |
| 958 | /* Prelookup - Index and Fraction |
| 959 | Index Search method: 'binary' |
| 960 | Extrapolation method: 'Clip' |
| 961 | Use previous index: 'off' |
| 962 | Use last breakpoint for index at or above upper limit: 'on' |
| 963 | Remove protection against out-of-range input in generated code: 'off' |
| 964 | */ |
| 965 | if (u1 <= bp1[0U]) { |
| 966 | iLeft = 0U; |
| 967 | frac = 0.0; |
| 968 | } else if (u1 < bp1[maxIndex[1U]]) { |
| 969 | /* Binary Search */ |
| 970 | bpIdx = maxIndex[1U] >> 1U; |
| 971 | iLeft = 0U; |
| 972 | iRght = maxIndex[1U]; |
| 973 | while (iRght - iLeft > 1U) { |
| 974 | if (u1 < bp1[bpIdx]) { |
| 975 | iRght = bpIdx; |
| 976 | } else { |
| 977 | iLeft = bpIdx; |
| 978 | } |
| 979 | |
| 980 | bpIdx = (iRght + iLeft) >> 1U; |
| 981 | } |
| 982 | |
| 983 | frac = (u1 - bp1[iLeft]) / (bp1[iLeft + 1U] - bp1[iLeft]); |
| 984 | } else { |
| 985 | iLeft = maxIndex[1U]; |
| 986 | frac = 0.0; |
| 987 | } |
| 988 | |
| 989 | /* Interpolation 2-D |
| 990 | Interpolation method: 'Linear point-slope' |
| 991 | Use last breakpoint for index at or above upper limit: 'on' |
| 992 | Overflow mode: 'portable wrapping' |
| 993 | */ |
| 994 | bpIdx = iLeft * stride + bpIndices[0U]; |
| 995 | if (bpIndices[0U] == maxIndex[0U]) { |
| 996 | y = table[bpIdx]; |
| 997 | } else { |
| 998 | y = (table[bpIdx + 1U] - table[bpIdx]) * fractions[0U] + table[bpIdx]; |
| 999 | } |
| 1000 | |
| 1001 | if (iLeft == maxIndex[1U]) { |
| 1002 | } else { |
| 1003 | bpIdx += stride; |
| 1004 | if (bpIndices[0U] == maxIndex[0U]) { |
| 1005 | yR_1d = table[bpIdx]; |
| 1006 | } else { |
| 1007 | yR_1d = (table[bpIdx + 1U] - table[bpIdx]) * fractions[0U] + table[bpIdx]; |
| 1008 | } |
| 1009 | |
| 1010 | y += (yR_1d - y) * frac; |
| 1011 | } |
| 1012 | |
| 1013 | return y; |
| 1014 | } |
| 1015 | |
| 1016 | real_T look1_binlxpw(real_T u0, const real_T bp0[], const real_T table[], |
| 1017 | uint32_T maxIndex) |
| 1018 | { |
| 1019 | real_T frac; |
| 1020 | uint32_T iRght; |
| 1021 | uint32_T iLeft; |
| 1022 | uint32_T bpIdx; |
| 1023 | |
| 1024 | /* Lookup 1-D |
| 1025 | Search method: 'binary' |
| 1026 | Use previous index: 'off' |
| 1027 | Interpolation method: 'Linear point-slope' |
| 1028 | Extrapolation method: 'Linear' |
| 1029 | Use last breakpoint for index at or above upper limit: 'off' |
| 1030 | Remove protection against out-of-range input in generated code: 'off' |
| 1031 | */ |
| 1032 | /* Prelookup - Index and Fraction |
| 1033 | Index Search method: 'binary' |
| 1034 | Extrapolation method: 'Linear' |
| 1035 | Use previous index: 'off' |
| 1036 | Use last breakpoint for index at or above upper limit: 'off' |
| 1037 | Remove protection against out-of-range input in generated code: 'off' |
| 1038 | */ |
| 1039 | if (u0 <= bp0[0U]) { |
| 1040 | iLeft = 0U; |
| 1041 | frac = (u0 - bp0[0U]) / (bp0[1U] - bp0[0U]); |
| 1042 | } else if (u0 < bp0[maxIndex]) { |
| 1043 | /* Binary Search */ |
| 1044 | bpIdx = maxIndex >> 1U; |
| 1045 | iLeft = 0U; |
| 1046 | iRght = maxIndex; |
| 1047 | while (iRght - iLeft > 1U) { |
| 1048 | if (u0 < bp0[bpIdx]) { |
| 1049 | iRght = bpIdx; |
| 1050 | } else { |
| 1051 | iLeft = bpIdx; |
| 1052 | } |
| 1053 | |
| 1054 | bpIdx = (iRght + iLeft) >> 1U; |
| 1055 | } |
| 1056 | |
| 1057 | frac = (u0 - bp0[iLeft]) / (bp0[iLeft + 1U] - bp0[iLeft]); |
| 1058 | } else { |
| 1059 | iLeft = maxIndex - 1U; |
| 1060 | frac = (u0 - bp0[maxIndex - 1U]) / (bp0[maxIndex] - bp0[maxIndex - 1U]); |
| 1061 | } |
| 1062 | |
| 1063 | /* Interpolation 1-D |
| 1064 | Interpolation method: 'Linear point-slope' |
| 1065 | Use last breakpoint for index at or above upper limit: 'off' |
| 1066 | Overflow mode: 'portable wrapping' |
| 1067 | */ |
| 1068 | return (table[iLeft + 1U] - table[iLeft]) * frac + table[iLeft]; |
| 1069 | } |
| 1070 | |
| 1071 | /* |
| 1072 | * Output and update for atomic system: |
| 1073 | * '<S82>/If_Then_Else' |
| 1074 | * '<S83>/If_Then_Else' |
| 1075 | * '<S83>/If_Then_Else1' |
| 1076 | * '<S89>/If_Then_Else' |
| 1077 | * '<S89>/If_Then_Else1' |
| 1078 | * '<S90>/If_Then_Else' |
| 1079 | * '<S90>/If_Then_Else1' |
| 1080 | * '<S121>/If_Then_Else' |
| 1081 | * '<S124>/If_Then_Else' |
| 1082 | * '<S126>/If_Then_Else' |
| 1083 | * ... |
| 1084 | */ |
| 1085 | void L4_MABX_If_Then_Else(boolean_T rtu_If, real_T rtu_Then, real_T rtu_Else, |
| 1086 | B_If_Then_Else_L4_MABX_T *localB) |
| 1087 | { |
| 1088 | /* Switch: '<S86>/Switch' */ |
| 1089 | if (rtu_If) { |
| 1090 | localB->Switch = rtu_Then; |
| 1091 | } else { |
| 1092 | localB->Switch = rtu_Else; |
| 1093 | } |
| 1094 | |
| 1095 | /* End of Switch: '<S86>/Switch' */ |
| 1096 | } |
| 1097 | |
| 1098 | /* |
| 1099 | * System initialize for enable system: |
| 1100 | * '<S112>/Calculate_D_term' |
| 1101 | * '<S150>/Calculate_D_term' |
| 1102 | * '<S244>/Calculate_D_term' |
| 1103 | */ |
| 1104 | void L4_MA_Calculate_D_term_Init(B_Calculate_D_term_L4_MABX_T *localB, |
| 1105 | DW_Calculate_D_term_L4_MABX_T *localDW, P_Calculate_D_term_L4_MABX_T *localP) |
| 1106 | { |
| 1107 | /* InitializeConditions for UnitDelay: '<S121>/Unit_Delay1' */ |
| 1108 | localDW->Unit_Delay1_DSTATE = localP->Unit_Delay1_InitialCondition; |
| 1109 | |
| 1110 | /* InitializeConditions for UnitDelay: '<S121>/Unit_Delay2' */ |
| 1111 | localDW->Unit_Delay2_DSTATE = localP->Unit_Delay2_InitialCondition; |
| 1112 | |
| 1113 | /* InitializeConditions for UnitDelay: '<S122>/FixPt Unit Delay2' */ |
| 1114 | localDW->FixPtUnitDelay2_DSTATE = localP->FixPtUnitDelay2_InitialConditio; |
| 1115 | |
| 1116 | /* InitializeConditions for UnitDelay: '<S122>/FixPt Unit Delay1' */ |
| 1117 | localDW->FixPtUnitDelay1_DSTATE = localP->FixPtUnitDelay1_InitialConditio; |
| 1118 | |
| 1119 | /* SystemInitialize for Outport: '<S116>/GPID_d_term' */ |
| 1120 | localB->Subtract = localP->GPID_d_term_Y0; |
| 1121 | } |
| 1122 | |
| 1123 | /* |
| 1124 | * System reset for enable system: |
| 1125 | * '<S112>/Calculate_D_term' |
| 1126 | * '<S150>/Calculate_D_term' |
| 1127 | * '<S244>/Calculate_D_term' |
| 1128 | */ |
| 1129 | void L4_M_Calculate_D_term_Reset(DW_Calculate_D_term_L4_MABX_T *localDW, |
| 1130 | P_Calculate_D_term_L4_MABX_T *localP) |
| 1131 | { |
| 1132 | /* InitializeConditions for UnitDelay: '<S121>/Unit_Delay1' */ |
| 1133 | localDW->Unit_Delay1_DSTATE = localP->Unit_Delay1_InitialCondition; |
| 1134 | |
| 1135 | /* InitializeConditions for UnitDelay: '<S121>/Unit_Delay2' */ |
| 1136 | localDW->Unit_Delay2_DSTATE = localP->Unit_Delay2_InitialCondition; |
| 1137 | |
| 1138 | /* InitializeConditions for UnitDelay: '<S122>/FixPt Unit Delay2' */ |
| 1139 | localDW->FixPtUnitDelay2_DSTATE = localP->FixPtUnitDelay2_InitialConditio; |
| 1140 | |
| 1141 | /* InitializeConditions for UnitDelay: '<S122>/FixPt Unit Delay1' */ |
| 1142 | localDW->FixPtUnitDelay1_DSTATE = localP->FixPtUnitDelay1_InitialConditio; |
| 1143 | } |
| 1144 | |
| 1145 | /* |
| 1146 | * Disable for enable system: |
| 1147 | * '<S112>/Calculate_D_term' |
| 1148 | * '<S150>/Calculate_D_term' |
| 1149 | * '<S244>/Calculate_D_term' |
| 1150 | */ |
| 1151 | void L4_Calculate_D_term_Disable(B_Calculate_D_term_L4_MABX_T *localB, |
| 1152 | DW_Calculate_D_term_L4_MABX_T *localDW, P_Calculate_D_term_L4_MABX_T *localP) |
| 1153 | { |
| 1154 | /* Disable for Outport: '<S116>/GPID_d_term' */ |
| 1155 | localB->Subtract = localP->GPID_d_term_Y0; |
| 1156 | localDW->Calculate_D_term_MODE = false; |
| 1157 | } |
| 1158 | |
| 1159 | /* |
| 1160 | * Start for enable system: |
| 1161 | * '<S112>/Calculate_D_term' |
| 1162 | * '<S150>/Calculate_D_term' |
| 1163 | * '<S244>/Calculate_D_term' |
| 1164 | */ |
| 1165 | void L4_M_Calculate_D_term_Start(DW_Calculate_D_term_L4_MABX_T *localDW) |
| 1166 | { |
| 1167 | localDW->Calculate_D_term_MODE = false; |
| 1168 | } |
| 1169 | |
| 1170 | /* |
| 1171 | * Outputs for enable system: |
| 1172 | * '<S112>/Calculate_D_term' |
| 1173 | * '<S150>/Calculate_D_term' |
| 1174 | * '<S244>/Calculate_D_term' |
| 1175 | */ |
| 1176 | void L4_MABX_Calculate_D_term(boolean_T rtu_Enable, real_T rtu_GPID_Kd, real_T |
| 1177 | rtu_GPID_dT, boolean_T rtu_F_GPID_reset_gov, real_T rtu_GPID_control_error, |
| 1178 | real_T rtu_GPID_T_filt_d, B_Calculate_D_term_L4_MABX_T *localB, |
| 1179 | DW_Calculate_D_term_L4_MABX_T *localDW, P_Calculate_D_term_L4_MABX_T *localP) |
| 1180 | { |
| 1181 | real_T maxV; |
| 1182 | real_T u1; |
| 1183 | real_T u2; |
| 1184 | |
| 1185 | /* Outputs for Enabled SubSystem: '<S112>/Calculate_D_term' incorporates: |
| 1186 | * EnablePort: '<S116>/Enable' |
| 1187 | */ |
| 1188 | if (rtu_Enable) { |
| 1189 | if (!localDW->Calculate_D_term_MODE) { |
| 1190 | L4_M_Calculate_D_term_Reset(localDW, localP); |
| 1191 | localDW->Calculate_D_term_MODE = true; |
| 1192 | } |
| 1193 | |
| 1194 | /* UnitDelay: '<S121>/Unit_Delay1' */ |
| 1195 | localB->Unit_Delay1 = localDW->Unit_Delay1_DSTATE; |
| 1196 | |
| 1197 | /* Logic: '<S121>/Logical Operator' */ |
| 1198 | localB->LogicalOperator = (rtu_F_GPID_reset_gov || localB->Unit_Delay1); |
| 1199 | |
| 1200 | /* MinMax: '<S121>/MinMax1' */ |
| 1201 | if ((rtu_GPID_dT > rtu_GPID_T_filt_d) || rtIsNaN(rtu_GPID_T_filt_d)) { |
| 1202 | maxV = rtu_GPID_dT; |
| 1203 | } else { |
| 1204 | maxV = rtu_GPID_T_filt_d; |
| 1205 | } |
| 1206 | |
| 1207 | localB->MinMax1 = maxV; |
| 1208 | |
| 1209 | /* End of MinMax: '<S121>/MinMax1' */ |
| 1210 | |
| 1211 | /* Saturate: '<S121>/Saturation' */ |
| 1212 | maxV = localB->MinMax1; |
| 1213 | u1 = localP->Saturation_LowerSat; |
| 1214 | u2 = localP->Saturation_UpperSat; |
| 1215 | if (maxV > u2) { |
| 1216 | localB->Saturation = u2; |
| 1217 | } else if (maxV < u1) { |
| 1218 | localB->Saturation = u1; |
| 1219 | } else { |
| 1220 | localB->Saturation = maxV; |
| 1221 | } |
| 1222 | |
| 1223 | /* End of Saturate: '<S121>/Saturation' */ |
| 1224 | |
| 1225 | /* Product: '<S121>/Divide' */ |
| 1226 | localB->Divide = rtu_GPID_dT / localB->Saturation; |
| 1227 | |
| 1228 | /* Product: '<S121>/Product2' */ |
| 1229 | localB->Product2 = rtu_GPID_control_error * localB->Divide; |
| 1230 | |
| 1231 | /* Sum: '<S121>/Subtract1' incorporates: |
| 1232 | * Constant: '<S121>/Constant1' |
| 1233 | */ |
| 1234 | localB->Subtract1 = localP->Constant1_Value - localB->Divide; |
| 1235 | |
| 1236 | /* UnitDelay: '<S121>/Unit_Delay2' */ |
| 1237 | localB->Unit_Delay2 = localDW->Unit_Delay2_DSTATE; |
| 1238 | |
| 1239 | /* Product: '<S121>/Product1' */ |
| 1240 | localB->Product1 = localB->Subtract1 * localB->Unit_Delay2; |
| 1241 | |
| 1242 | /* Sum: '<S121>/Add1' */ |
| 1243 | localB->Add1 = localB->Product2 + localB->Product1; |
| 1244 | |
| 1245 | /* Outputs for Atomic SubSystem: '<S121>/If_Then_Else' */ |
| 1246 | L4_MABX_If_Then_Else(localB->LogicalOperator, rtu_GPID_control_error, |
| 1247 | localB->Add1, &localB->If_Then_Else); |
| 1248 | |
| 1249 | /* End of Outputs for SubSystem: '<S121>/If_Then_Else' */ |
| 1250 | |
| 1251 | /* Product: '<S116>/Divide' */ |
| 1252 | localB->Divide_k = localB->If_Then_Else.Switch / rtu_GPID_dT * rtu_GPID_Kd; |
| 1253 | |
| 1254 | /* UnitDelay: '<S122>/FixPt Unit Delay2' */ |
| 1255 | localB->FixPtUnitDelay2 = localDW->FixPtUnitDelay2_DSTATE; |
| 1256 | |
| 1257 | /* Logic: '<S122>/FixPt Logical Operator' */ |
| 1258 | localB->FixPtLogicalOperator = (uint8_T)(rtu_F_GPID_reset_gov || |
| 1259 | (localB->FixPtUnitDelay2 != 0)); |
| 1260 | |
| 1261 | /* UnitDelay: '<S122>/FixPt Unit Delay1' */ |
| 1262 | localB->Xold = localDW->FixPtUnitDelay1_DSTATE; |
| 1263 | |
| 1264 | /* Switch: '<S122>/Init' */ |
| 1265 | if (localB->FixPtLogicalOperator != 0) { |
| 1266 | localB->Init = localB->Divide_k; |
| 1267 | } else { |
| 1268 | localB->Init = localB->Xold; |
| 1269 | } |
| 1270 | |
| 1271 | /* End of Switch: '<S122>/Init' */ |
| 1272 | |
| 1273 | /* Sum: '<S116>/Subtract' */ |
| 1274 | localB->Subtract = localB->Divide_k - localB->Init; |
| 1275 | |
| 1276 | /* Switch: '<S122>/Reset' */ |
| 1277 | localB->Xnew = localB->Divide_k; |
| 1278 | } else { |
| 1279 | if (localDW->Calculate_D_term_MODE) { |
| 1280 | L4_Calculate_D_term_Disable(localB, localDW, localP); |
| 1281 | } |
| 1282 | } |
| 1283 | |
| 1284 | /* End of Outputs for SubSystem: '<S112>/Calculate_D_term' */ |
| 1285 | } |
| 1286 | |
| 1287 | /* |
| 1288 | * Update for enable system: |
| 1289 | * '<S112>/Calculate_D_term' |
| 1290 | * '<S150>/Calculate_D_term' |
| 1291 | * '<S244>/Calculate_D_term' |
| 1292 | */ |
| 1293 | void L4__Calculate_D_term_Update(B_Calculate_D_term_L4_MABX_T *localB, |
| 1294 | DW_Calculate_D_term_L4_MABX_T *localDW, P_Calculate_D_term_L4_MABX_T *localP) |
| 1295 | { |
| 1296 | /* Update for Enabled SubSystem: '<S112>/Calculate_D_term' incorporates: |
| 1297 | * EnablePort: '<S116>/Enable' |
| 1298 | */ |
| 1299 | if (localDW->Calculate_D_term_MODE) { |
| 1300 | /* Update for UnitDelay: '<S121>/Unit_Delay1' incorporates: |
| 1301 | * Constant: '<S121>/Constant' |
| 1302 | */ |
| 1303 | localDW->Unit_Delay1_DSTATE = localP->Constant_Value; |
| 1304 | |
| 1305 | /* Update for UnitDelay: '<S121>/Unit_Delay2' */ |
| 1306 | localDW->Unit_Delay2_DSTATE = localB->If_Then_Else.Switch; |
| 1307 | |
| 1308 | /* Update for UnitDelay: '<S122>/FixPt Unit Delay2' incorporates: |
| 1309 | * Constant: '<S122>/FixPt Constant' |
| 1310 | */ |
| 1311 | localDW->FixPtUnitDelay2_DSTATE = localP->FixPtConstant_Value; |
| 1312 | |
| 1313 | /* Update for UnitDelay: '<S122>/FixPt Unit Delay1' */ |
| 1314 | localDW->FixPtUnitDelay1_DSTATE = localB->Xnew; |
| 1315 | } |
| 1316 | |
| 1317 | /* End of Update for SubSystem: '<S112>/Calculate_D_term' */ |
| 1318 | } |
| 1319 | |
| 1320 | /* |
| 1321 | * Output and update for atomic system: |
| 1322 | * '<S126>/If_Then_Else3' |
| 1323 | * '<S164>/If_Then_Else3' |
| 1324 | * '<S258>/If_Then_Else3' |
| 1325 | * '<S472>/If_Then_Else' |
| 1326 | * '<S1082>/If_Then_Else' |
| 1327 | */ |
| 1328 | void L4_MABX_If_Then_Else3(boolean_T rtu_If, boolean_T rtu_Then, boolean_T |
| 1329 | rtu_Else, B_If_Then_Else_L4_MABX_c_T *localB) |
| 1330 | { |
| 1331 | /* Switch: '<S134>/Switch' */ |
| 1332 | if (rtu_If) { |
| 1333 | localB->Switch = rtu_Then; |
| 1334 | } else { |
| 1335 | localB->Switch = rtu_Else; |
| 1336 | } |
| 1337 | |
| 1338 | /* End of Switch: '<S134>/Switch' */ |
| 1339 | } |
| 1340 | |
| 1341 | /* |
| 1342 | * System initialize for enable system: |
| 1343 | * '<S112>/Calculate_I_term' |
| 1344 | * '<S150>/Calculate_I_term' |
| 1345 | * '<S244>/Calculate_I_term' |
| 1346 | */ |
| 1347 | void L4_MA_Calculate_I_term_Init(B_Calculate_I_term_L4_MABX_T *localB, |
| 1348 | DW_Calculate_I_term_L4_MABX_T *localDW, P_Calculate_I_term_L4_MABX_T *localP) |
| 1349 | { |
| 1350 | /* InitializeConditions for UnitDelay: '<S128>/FixPt Unit Delay2' */ |
| 1351 | localDW->FixPtUnitDelay2_DSTATE = localP->FixPtUnitDelay2_InitialConditio; |
| 1352 | |
| 1353 | /* InitializeConditions for UnitDelay: '<S128>/FixPt Unit Delay1' */ |
| 1354 | localDW->FixPtUnitDelay1_DSTATE = localP->FixPtUnitDelay1_InitialConditio; |
| 1355 | |
| 1356 | /* InitializeConditions for UnitDelay: '<S117>/Unit_Delay' */ |
| 1357 | localDW->Unit_Delay_DSTATE = localP->Unit_Delay_InitialCondition; |
| 1358 | |
| 1359 | /* SystemInitialize for Enabled SubSystem: '<S117>/Initialize_integral_term' */ |
| 1360 | /* SystemInitialize for Outport: '<S125>/GPID_i_sum_error_init' */ |
| 1361 | localB->Subtract2 = localP->GPID_i_sum_error_init_Y0; |
| 1362 | |
| 1363 | /* End of SystemInitialize for SubSystem: '<S117>/Initialize_integral_term' */ |
| 1364 | |
| 1365 | /* SystemInitialize for Outport: '<S117>/GPID_i_term' */ |
| 1366 | localB->If_Then_Else.Switch = localP->GPID_i_term_Y0; |
| 1367 | |
| 1368 | /* SystemInitialize for Outport: '<S117>/F_GPID_hold_i_term' */ |
| 1369 | localB->LogicalOperator2 = localP->F_GPID_hold_i_term_Y0; |
| 1370 | } |
| 1371 | |
| 1372 | /* |
| 1373 | * System reset for enable system: |
| 1374 | * '<S112>/Calculate_I_term' |
| 1375 | * '<S150>/Calculate_I_term' |
| 1376 | * '<S244>/Calculate_I_term' |
| 1377 | */ |
| 1378 | void L4_M_Calculate_I_term_Reset(DW_Calculate_I_term_L4_MABX_T *localDW, |
| 1379 | P_Calculate_I_term_L4_MABX_T *localP) |
| 1380 | { |
| 1381 | /* InitializeConditions for UnitDelay: '<S128>/FixPt Unit Delay2' */ |
| 1382 | localDW->FixPtUnitDelay2_DSTATE = localP->FixPtUnitDelay2_InitialConditio; |
| 1383 | |
| 1384 | /* InitializeConditions for UnitDelay: '<S128>/FixPt Unit Delay1' */ |
| 1385 | localDW->FixPtUnitDelay1_DSTATE = localP->FixPtUnitDelay1_InitialConditio; |
| 1386 | |
| 1387 | /* InitializeConditions for UnitDelay: '<S117>/Unit_Delay' */ |
| 1388 | localDW->Unit_Delay_DSTATE = localP->Unit_Delay_InitialCondition; |
| 1389 | } |
| 1390 | |
| 1391 | /* |
| 1392 | * Disable for enable system: |
| 1393 | * '<S112>/Calculate_I_term' |
| 1394 | * '<S150>/Calculate_I_term' |
| 1395 | * '<S244>/Calculate_I_term' |
| 1396 | */ |
| 1397 | void L4_Calculate_I_term_Disable(B_Calculate_I_term_L4_MABX_T *localB, |
| 1398 | DW_Calculate_I_term_L4_MABX_T *localDW, P_Calculate_I_term_L4_MABX_T *localP) |
| 1399 | { |
| 1400 | /* Disable for Outport: '<S117>/GPID_i_term' */ |
| 1401 | localB->If_Then_Else.Switch = localP->GPID_i_term_Y0; |
| 1402 | |
| 1403 | /* Disable for Outport: '<S117>/F_GPID_hold_i_term' */ |
| 1404 | localB->LogicalOperator2 = localP->F_GPID_hold_i_term_Y0; |
| 1405 | localDW->Calculate_I_term_MODE = false; |
| 1406 | } |
| 1407 | |
| 1408 | /* |
| 1409 | * Start for enable system: |
| 1410 | * '<S112>/Calculate_I_term' |
| 1411 | * '<S150>/Calculate_I_term' |
| 1412 | * '<S244>/Calculate_I_term' |
| 1413 | */ |
| 1414 | void L4_M_Calculate_I_term_Start(DW_Calculate_I_term_L4_MABX_T *localDW) |
| 1415 | { |
| 1416 | localDW->Calculate_I_term_MODE = false; |
| 1417 | } |
| 1418 | |
| 1419 | /* |
| 1420 | * Outputs for enable system: |
| 1421 | * '<S112>/Calculate_I_term' |
| 1422 | * '<S150>/Calculate_I_term' |
| 1423 | * '<S244>/Calculate_I_term' |
| 1424 | */ |
| 1425 | void L4_MABX_Calculate_I_term(boolean_T rtu_Enable, real_T rtu_GPID_p_term, |
| 1426 | real_T rtu_GPID_Ki, real_T rtu_GPID_actual_system_output, real_T |
| 1427 | rtu_GPID_control_error, boolean_T rtu_F_GPID_reset_gov, real_T rtu_GPID_dT, |
| 1428 | real_T rtu_GPID_feed_forward, boolean_T rtu_F_GPID_aw_cond_integration, real_T |
| 1429 | rtu_GPID_aw_hysteresis, boolean_T rtu_F_GPID_aw_hold_i_term, real_T |
| 1430 | rtu_GPID_output_unlim_prev, B_Calculate_I_term_L4_MABX_T *localB, |
| 1431 | DW_Calculate_I_term_L4_MABX_T *localDW, P_Calculate_I_term_L4_MABX_T *localP) |
| 1432 | { |
| 1433 | /* Outputs for Enabled SubSystem: '<S112>/Calculate_I_term' incorporates: |
| 1434 | * EnablePort: '<S117>/Enable' |
| 1435 | */ |
| 1436 | if (rtu_Enable) { |
| 1437 | if (!localDW->Calculate_I_term_MODE) { |
| 1438 | L4_M_Calculate_I_term_Reset(localDW, localP); |
| 1439 | localDW->Calculate_I_term_MODE = true; |
| 1440 | } |
| 1441 | |
| 1442 | /* Outputs for Enabled SubSystem: '<S117>/Initialize_integral_term' incorporates: |
| 1443 | * EnablePort: '<S125>/Enable' |
| 1444 | */ |
| 1445 | if (rtu_F_GPID_reset_gov) { |
| 1446 | /* Product: '<S125>/Product' */ |
| 1447 | localB->Product_j = rtu_GPID_Ki * rtu_GPID_dT * rtu_GPID_control_error; |
| 1448 | |
| 1449 | /* Sum: '<S125>/Subtract' */ |
| 1450 | localB->Subtract_g = rtu_GPID_actual_system_output - rtu_GPID_feed_forward; |
| 1451 | |
| 1452 | /* Sum: '<S125>/Subtract1' */ |
| 1453 | localB->Subtract1_k = localB->Subtract_g - rtu_GPID_p_term; |
| 1454 | |
| 1455 | /* Sum: '<S125>/Subtract2' */ |
| 1456 | localB->Subtract2 = localB->Subtract1_k - localB->Product_j; |
| 1457 | } |
| 1458 | |
| 1459 | /* End of Outputs for SubSystem: '<S117>/Initialize_integral_term' */ |
| 1460 | |
| 1461 | /* UnitDelay: '<S128>/FixPt Unit Delay2' */ |
| 1462 | localB->FixPtUnitDelay2 = localDW->FixPtUnitDelay2_DSTATE; |
| 1463 | |
| 1464 | /* Logic: '<S128>/FixPt Logical Operator' */ |
| 1465 | localB->FixPtLogicalOperator = (uint8_T)(rtu_F_GPID_reset_gov || |
| 1466 | (localB->FixPtUnitDelay2 != 0)); |
| 1467 | |
| 1468 | /* UnitDelay: '<S128>/FixPt Unit Delay1' */ |
| 1469 | localB->Xold = localDW->FixPtUnitDelay1_DSTATE; |
| 1470 | |
| 1471 | /* Switch: '<S128>/Init' */ |
| 1472 | if (localB->FixPtLogicalOperator != 0) { |
| 1473 | localB->Init = localB->Subtract2; |
| 1474 | } else { |
| 1475 | localB->Init = localB->Xold; |
| 1476 | } |
| 1477 | |
| 1478 | /* End of Switch: '<S128>/Init' */ |
| 1479 | |
| 1480 | /* Product: '<S124>/Product1' */ |
| 1481 | localB->Product1 = rtu_GPID_Ki * rtu_GPID_control_error * rtu_GPID_dT; |
| 1482 | |
| 1483 | /* Sum: '<S124>/Add' */ |
| 1484 | localB->Add = localB->Init + localB->Product1; |
| 1485 | |
| 1486 | /* UnitDelay: '<S117>/Unit_Delay' */ |
| 1487 | localB->Unit_Delay = localDW->Unit_Delay_DSTATE; |
| 1488 | |
| 1489 | /* Outputs for Atomic SubSystem: '<S126>/If_Then_Else' */ |
| 1490 | |
| 1491 | /* Constant: '<S126>/Constant' */ |
| 1492 | L4_MABX_If_Then_Else(rtu_F_GPID_reset_gov, localP->Constant_Value, |
| 1493 | localB->Unit_Delay, &localB->If_Then_Else_c); |
| 1494 | |
| 1495 | /* End of Outputs for SubSystem: '<S126>/If_Then_Else' */ |
| 1496 | |
| 1497 | /* Outputs for Atomic SubSystem: '<S126>/If_Then_Else2' */ |
| 1498 | L4_MABX_If_Then_Else(rtu_F_GPID_reset_gov, rtu_GPID_actual_system_output, |
| 1499 | rtu_GPID_output_unlim_prev, &localB->If_Then_Else2); |
| 1500 | |
| 1501 | /* End of Outputs for SubSystem: '<S126>/If_Then_Else2' */ |
| 1502 | |
| 1503 | /* Outputs for Atomic SubSystem: '<S126>/If_Then_Else1' */ |
| 1504 | L4_MABX_If_Then_Else(rtu_F_GPID_aw_cond_integration, |
| 1505 | localB->If_Then_Else_c.Switch, |
| 1506 | localB->If_Then_Else2.Switch, &localB->If_Then_Else1); |
| 1507 | |
| 1508 | /* End of Outputs for SubSystem: '<S126>/If_Then_Else1' */ |
| 1509 | |
| 1510 | /* Product: '<S126>/Product' */ |
| 1511 | localB->Product = rtu_GPID_Ki * rtu_GPID_control_error * |
| 1512 | localB->If_Then_Else1.Switch; |
| 1513 | |
| 1514 | /* RelationalOperator: '<S129>/Compare' incorporates: |
| 1515 | * Constant: '<S129>/Constant' |
| 1516 | */ |
| 1517 | localB->Compare = (localB->Product > localP->Constant_Value_p); |
| 1518 | |
| 1519 | /* RelationalOperator: '<S130>/Compare' incorporates: |
| 1520 | * Constant: '<S130>/Constant' |
| 1521 | */ |
| 1522 | localB->Compare_n = (localB->Unit_Delay >= localP->Constant_Value_b); |
| 1523 | |
| 1524 | /* Sum: '<S126>/Subtract' */ |
| 1525 | localB->Subtract = localB->If_Then_Else2.Switch - |
| 1526 | rtu_GPID_actual_system_output; |
| 1527 | |
| 1528 | /* RelationalOperator: '<S126>/Relational Operator1' */ |
| 1529 | localB->RelationalOperator1 = (localB->Subtract > rtu_GPID_aw_hysteresis); |
| 1530 | |
| 1531 | /* Sum: '<S126>/Subtract1' */ |
| 1532 | localB->Subtract1 = rtu_GPID_actual_system_output - |
| 1533 | localB->If_Then_Else2.Switch; |
| 1534 | |
| 1535 | /* RelationalOperator: '<S126>/Relational Operator2' */ |
| 1536 | localB->RelationalOperator2 = (localB->Subtract1 > rtu_GPID_aw_hysteresis); |
| 1537 | |
| 1538 | /* Outputs for Atomic SubSystem: '<S126>/If_Then_Else3' */ |
| 1539 | L4_MABX_If_Then_Else3(localB->Compare_n, localB->RelationalOperator1, |
| 1540 | localB->RelationalOperator2, &localB->If_Then_Else3); |
| 1541 | |
| 1542 | /* End of Outputs for SubSystem: '<S126>/If_Then_Else3' */ |
| 1543 | |
| 1544 | /* Logic: '<S126>/Logical Operator1' */ |
| 1545 | localB->LogicalOperator1 = (localB->Compare && localB->If_Then_Else3.Switch); |
| 1546 | |
| 1547 | /* Logic: '<S126>/Logical Operator2' */ |
| 1548 | localB->LogicalOperator2 = (localB->LogicalOperator1 || |
| 1549 | rtu_F_GPID_aw_hold_i_term); |
| 1550 | |
| 1551 | /* Outputs for Atomic SubSystem: '<S124>/If_Then_Else' */ |
| 1552 | L4_MABX_If_Then_Else(localB->LogicalOperator2, localB->Init, localB->Add, |
| 1553 | &localB->If_Then_Else); |
| 1554 | |
| 1555 | /* End of Outputs for SubSystem: '<S124>/If_Then_Else' */ |
| 1556 | |
| 1557 | /* Switch: '<S128>/Reset' */ |
| 1558 | if (rtu_F_GPID_reset_gov) { |
| 1559 | localB->Xnew = localB->Subtract2; |
| 1560 | } else { |
| 1561 | localB->Xnew = localB->If_Then_Else.Switch; |
| 1562 | } |
| 1563 | |
| 1564 | /* End of Switch: '<S128>/Reset' */ |
| 1565 | } else { |
| 1566 | if (localDW->Calculate_I_term_MODE) { |
| 1567 | L4_Calculate_I_term_Disable(localB, localDW, localP); |
| 1568 | } |
| 1569 | } |
| 1570 | |
| 1571 | /* End of Outputs for SubSystem: '<S112>/Calculate_I_term' */ |
| 1572 | } |
| 1573 | |
| 1574 | /* |
| 1575 | * Update for enable system: |
| 1576 | * '<S112>/Calculate_I_term' |
| 1577 | * '<S150>/Calculate_I_term' |
| 1578 | * '<S244>/Calculate_I_term' |
| 1579 | */ |
| 1580 | void L4__Calculate_I_term_Update(B_Calculate_I_term_L4_MABX_T *localB, |
| 1581 | DW_Calculate_I_term_L4_MABX_T *localDW, P_Calculate_I_term_L4_MABX_T *localP) |
| 1582 | { |
| 1583 | /* Update for Enabled SubSystem: '<S112>/Calculate_I_term' incorporates: |
| 1584 | * EnablePort: '<S117>/Enable' |
| 1585 | */ |
| 1586 | if (localDW->Calculate_I_term_MODE) { |
| 1587 | /* Update for UnitDelay: '<S128>/FixPt Unit Delay2' incorporates: |
| 1588 | * Constant: '<S128>/FixPt Constant' |
| 1589 | */ |
| 1590 | localDW->FixPtUnitDelay2_DSTATE = localP->FixPtConstant_Value; |
| 1591 | |
| 1592 | /* Update for UnitDelay: '<S128>/FixPt Unit Delay1' */ |
| 1593 | localDW->FixPtUnitDelay1_DSTATE = localB->Xnew; |
| 1594 | |
| 1595 | /* Update for UnitDelay: '<S117>/Unit_Delay' */ |
| 1596 | localDW->Unit_Delay_DSTATE = localB->If_Then_Else.Switch; |
| 1597 | } |
| 1598 | |
| 1599 | /* End of Update for SubSystem: '<S112>/Calculate_I_term' */ |
| 1600 | } |
| 1601 | |
| 1602 | /* Output and update for atomic system: '<S104>/If_Then_Else' */ |
| 1603 | void L4_MABX_If_Then_Else_l(boolean_T rtu_If, boolean_T rtu_Then, boolean_T |
| 1604 | rtu_Else, B_If_Then_Else_L4_MABX_m_T *localB) |
| 1605 | { |
| 1606 | /* Switch: '<S182>/Switch' */ |
| 1607 | if (rtu_If) { |
| 1608 | localB->Switch = rtu_Then; |
| 1609 | } else { |
| 1610 | localB->Switch = rtu_Else; |
| 1611 | } |
| 1612 | |
| 1613 | /* End of Switch: '<S182>/Switch' */ |
| 1614 | } |
| 1615 | |
| 1616 | /* |
| 1617 | * Output and update for atomic system: |
| 1618 | * '<S183>/If_Then_Else' |
| 1619 | * '<S183>/If_Then_Else1' |
| 1620 | * '<S184>/If_Then_Else' |
| 1621 | * '<S184>/If_Then_Else1' |
| 1622 | * '<S280>/If_Then_Else' |
| 1623 | * '<S281>/If_Then_Else' |
| 1624 | * '<S281>/If_Then_Else1' |
| 1625 | * '<S366>/If_Then_Else' |
| 1626 | * '<S363>/If_Then_Else' |
| 1627 | * '<S372>/If_Then_Else' |
| 1628 | * ... |
| 1629 | */ |
| 1630 | void L4_MABX_If_Then_Else_g(boolean_T rtu_If, real_T rtu_Then, real_T rtu_Else, |
| 1631 | B_If_Then_Else_L4_MABX_k_T *localB) |
| 1632 | { |
| 1633 | /* Switch: '<S185>/Switch' */ |
| 1634 | if (rtu_If) { |
| 1635 | localB->Switch = rtu_Then; |
| 1636 | } else { |
| 1637 | localB->Switch = rtu_Else; |
| 1638 | } |
| 1639 | |
| 1640 | /* End of Switch: '<S185>/Switch' */ |
| 1641 | } |
| 1642 | |
| 1643 | /* |
| 1644 | * Output and update for atomic system: |
| 1645 | * '<S301>/If_Then_Else' |
| 1646 | * '<S316>/If_Then_Else' |
| 1647 | */ |
| 1648 | void L4_MABX_If_Then_Else_k(real_T rtu_If, real_T rtu_Then, real_T rtu_Else, |
| 1649 | B_If_Then_Else_L4_MABX_n_T *localB) |
| 1650 | { |
| 1651 | /* Switch: '<S303>/Switch' */ |
| 1652 | if (rtu_If != 0.0) { |
| 1653 | localB->Switch = rtu_Then; |
| 1654 | } else { |
| 1655 | localB->Switch = rtu_Else; |
| 1656 | } |
| 1657 | |
| 1658 | /* End of Switch: '<S303>/Switch' */ |
| 1659 | } |
| 1660 | |
| 1661 | /* Output and update for atomic system: '<S356>/If_Then_Else' */ |
| 1662 | void L4_MABX_If_Then_Else_m(boolean_T rtu_If, real_T rtu_Then, real_T rtu_Then_l, |
| 1663 | real_T rtu_Then_f, real_T rtu_Else, real_T rtu_Else_i, real_T rtu_Else_k, |
| 1664 | B_If_Then_Else_L4_MABX_h_T *localB) |
| 1665 | { |
| 1666 | /* Switch: '<S358>/Switch' */ |
| 1667 | if (rtu_If) { |
| 1668 | localB->Vehicle_speed_target = rtu_Then; |
| 1669 | localB->Vehicle_speed = rtu_Then_l; |
| 1670 | localB->Distance_m = rtu_Then_f; |
| 1671 | } else { |
| 1672 | localB->Vehicle_speed_target = rtu_Else; |
| 1673 | localB->Vehicle_speed = rtu_Else_i; |
| 1674 | localB->Distance_m = rtu_Else_k; |
| 1675 | } |
| 1676 | |
| 1677 | /* End of Switch: '<S358>/Switch' */ |
| 1678 | } |
| 1679 | |
| 1680 | /* System initialize for function-call system: '<S405>/Background_Task' */ |
| 1681 | void L4_MAB_Background_Task_Init(void) |
| 1682 | { |
| 1683 | /* InitializeConditions for S-Function (dsa_tcpip_bkg_sfcn): '<S415>/dsa_tcpip_bkg_sfcn' */ |
| 1684 | /* Level2 S-Function Block: '<S415>/dsa_tcpip_bkg_sfcn' (dsa_tcpip_bkg_sfcn) */ |
| 1685 | { |
| 1686 | SimStruct *rts = L4_MABX_M->childSfunctions[0]; |
| 1687 | sfcnInitializeConditions(rts); |
| 1688 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1689 | return; |
| 1690 | } |
| 1691 | } |
| 1692 | |
| 1693 | /* System reset for function-call system: '<S405>/Background_Task' */ |
| 1694 | void L4_MA_Background_Task_Reset(void) |
| 1695 | { |
| 1696 | /* InitializeConditions for S-Function (dsa_tcpip_bkg_sfcn): '<S415>/dsa_tcpip_bkg_sfcn' */ |
| 1697 | /* Level2 S-Function Block: '<S415>/dsa_tcpip_bkg_sfcn' (dsa_tcpip_bkg_sfcn) */ |
| 1698 | { |
| 1699 | SimStruct *rts = L4_MABX_M->childSfunctions[0]; |
| 1700 | sfcnInitializeConditions(rts); |
| 1701 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1702 | return; |
| 1703 | } |
| 1704 | } |
| 1705 | |
| 1706 | /* Start for function-call system: '<S405>/Background_Task' */ |
| 1707 | void L4_MA_Background_Task_Start(void) |
| 1708 | { |
| 1709 | /* Start for S-Function (dsa_tcpip_bkg_sfcn): '<S415>/dsa_tcpip_bkg_sfcn' */ |
| 1710 | /* Level2 S-Function Block: '<S415>/dsa_tcpip_bkg_sfcn' (dsa_tcpip_bkg_sfcn) */ |
| 1711 | { |
| 1712 | SimStruct *rts = L4_MABX_M->childSfunctions[0]; |
| 1713 | sfcnStart(rts); |
| 1714 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1715 | return; |
| 1716 | } |
| 1717 | } |
| 1718 | |
| 1719 | /* Output and update for function-call system: '<S405>/Background_Task' */ |
| 1720 | void L4_MABX_Background_Task(void) |
| 1721 | { |
| 1722 | /* S-Function (dsa_tcpip_bkg_sfcn): '<S415>/dsa_tcpip_bkg_sfcn' */ |
| 1723 | |
| 1724 | /* Level2 S-Function Block: '<S415>/dsa_tcpip_bkg_sfcn' (dsa_tcpip_bkg_sfcn) */ |
| 1725 | { |
| 1726 | SimStruct *rts = L4_MABX_M->childSfunctions[0]; |
| 1727 | sfcnOutputs(rts,9); |
| 1728 | } |
| 1729 | } |
| 1730 | |
| 1731 | /* Termination for function-call system: '<S405>/Background_Task' */ |
| 1732 | void L4_MAB_Background_Task_Term(void) |
| 1733 | { |
| 1734 | /* Terminate for S-Function (dsa_tcpip_bkg_sfcn): '<S415>/dsa_tcpip_bkg_sfcn' */ |
| 1735 | /* Level2 S-Function Block: '<S415>/dsa_tcpip_bkg_sfcn' (dsa_tcpip_bkg_sfcn) */ |
| 1736 | { |
| 1737 | SimStruct *rts = L4_MABX_M->childSfunctions[0]; |
| 1738 | sfcnTerminate(rts); |
| 1739 | } |
| 1740 | } |
| 1741 | |
| 1742 | /* System initialize for function-call system: '<S405>/IRQ_Level_2_SW_INT' */ |
| 1743 | void L4__IRQ_Level_2_SW_INT_Init(void) |
| 1744 | { |
| 1745 | /* InitializeConditions for S-Function (dsa_tcpip_irq_l2_sfcn): '<S416>/dsa_tcpip_irq_l2_sfcn' */ |
| 1746 | /* Level2 S-Function Block: '<S416>/dsa_tcpip_irq_l2_sfcn' (dsa_tcpip_irq_l2_sfcn) */ |
| 1747 | { |
| 1748 | SimStruct *rts = L4_MABX_M->childSfunctions[1]; |
| 1749 | sfcnInitializeConditions(rts); |
| 1750 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1751 | return; |
| 1752 | } |
| 1753 | } |
| 1754 | |
| 1755 | /* System reset for function-call system: '<S405>/IRQ_Level_2_SW_INT' */ |
| 1756 | void L4_IRQ_Level_2_SW_INT_Reset(void) |
| 1757 | { |
| 1758 | /* InitializeConditions for S-Function (dsa_tcpip_irq_l2_sfcn): '<S416>/dsa_tcpip_irq_l2_sfcn' */ |
| 1759 | /* Level2 S-Function Block: '<S416>/dsa_tcpip_irq_l2_sfcn' (dsa_tcpip_irq_l2_sfcn) */ |
| 1760 | { |
| 1761 | SimStruct *rts = L4_MABX_M->childSfunctions[1]; |
| 1762 | sfcnInitializeConditions(rts); |
| 1763 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1764 | return; |
| 1765 | } |
| 1766 | } |
| 1767 | |
| 1768 | /* Start for function-call system: '<S405>/IRQ_Level_2_SW_INT' */ |
| 1769 | void L4_IRQ_Level_2_SW_INT_Start(void) |
| 1770 | { |
| 1771 | /* Start for S-Function (dsa_tcpip_irq_l2_sfcn): '<S416>/dsa_tcpip_irq_l2_sfcn' */ |
| 1772 | /* Level2 S-Function Block: '<S416>/dsa_tcpip_irq_l2_sfcn' (dsa_tcpip_irq_l2_sfcn) */ |
| 1773 | { |
| 1774 | SimStruct *rts = L4_MABX_M->childSfunctions[1]; |
| 1775 | sfcnStart(rts); |
| 1776 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1777 | return; |
| 1778 | } |
| 1779 | } |
| 1780 | |
| 1781 | /* Output and update for function-call system: '<S405>/IRQ_Level_2_SW_INT' */ |
| 1782 | void L4_MABX_IRQ_Level_2_SW_INT(void) |
| 1783 | { |
| 1784 | /* S-Function (dsa_tcpip_irq_l2_sfcn): '<S416>/dsa_tcpip_irq_l2_sfcn' */ |
| 1785 | |
| 1786 | /* Level2 S-Function Block: '<S416>/dsa_tcpip_irq_l2_sfcn' (dsa_tcpip_irq_l2_sfcn) */ |
| 1787 | { |
| 1788 | SimStruct *rts = L4_MABX_M->childSfunctions[1]; |
| 1789 | sfcnOutputs(rts,10); |
| 1790 | } |
| 1791 | } |
| 1792 | |
| 1793 | /* Termination for function-call system: '<S405>/IRQ_Level_2_SW_INT' */ |
| 1794 | void L4__IRQ_Level_2_SW_INT_Term(void) |
| 1795 | { |
| 1796 | /* Terminate for S-Function (dsa_tcpip_irq_l2_sfcn): '<S416>/dsa_tcpip_irq_l2_sfcn' */ |
| 1797 | /* Level2 S-Function Block: '<S416>/dsa_tcpip_irq_l2_sfcn' (dsa_tcpip_irq_l2_sfcn) */ |
| 1798 | { |
| 1799 | SimStruct *rts = L4_MABX_M->childSfunctions[1]; |
| 1800 | sfcnTerminate(rts); |
| 1801 | } |
| 1802 | } |
| 1803 | |
| 1804 | /* System initialize for function-call system: '<S417>/Tcp Input Processing' */ |
| 1805 | void L4__TcpInputProcessing_Init(void) |
| 1806 | { |
| 1807 | /* SystemInitialize for S-Function (rti_commonblock): '<S419>/S-Function1' incorporates: |
| 1808 | * SubSystem: '<S405>/IRQ_Level_2_SW_INT' |
| 1809 | */ |
| 1810 | L4__IRQ_Level_2_SW_INT_Init(); |
| 1811 | |
| 1812 | /* End of SystemInitialize for S-Function (rti_commonblock): '<S419>/S-Function1' */ |
| 1813 | } |
| 1814 | |
| 1815 | /* System reset for function-call system: '<S417>/Tcp Input Processing' */ |
| 1816 | void L4_TcpInputProcessing_Reset(void) |
| 1817 | { |
| 1818 | /* SystemReset for S-Function (rti_commonblock): '<S419>/S-Function1' incorporates: |
| 1819 | * SubSystem: '<S405>/IRQ_Level_2_SW_INT' |
| 1820 | */ |
| 1821 | L4_IRQ_Level_2_SW_INT_Reset(); |
| 1822 | |
| 1823 | /* End of SystemReset for S-Function (rti_commonblock): '<S419>/S-Function1' */ |
| 1824 | } |
| 1825 | |
| 1826 | /* Start for function-call system: '<S417>/Tcp Input Processing' */ |
| 1827 | void L4_TcpInputProcessing_Start(void) |
| 1828 | { |
| 1829 | /* Start for S-Function (rti_commonblock): '<S419>/S-Function1' incorporates: |
| 1830 | * SubSystem: '<S405>/IRQ_Level_2_SW_INT' |
| 1831 | */ |
| 1832 | L4_IRQ_Level_2_SW_INT_Start(); |
| 1833 | |
| 1834 | /* End of Start for S-Function (rti_commonblock): '<S419>/S-Function1' */ |
| 1835 | } |
| 1836 | |
| 1837 | /* Output and update for function-call system: '<S417>/Tcp Input Processing' */ |
| 1838 | void L4_MABX_TcpInputProcessing(void) |
| 1839 | { |
| 1840 | /* S-Function (rti_commonblock): '<S419>/S-Function1' */ |
| 1841 | |
| 1842 | /* This comment workarounds a code generation problem */ |
| 1843 | |
| 1844 | /* dSPACE Software Interrupt Block: <S417>/Tcp Input Processing */ |
| 1845 | rtk_schedule_task(S_SOFTTASK,0); |
| 1846 | |
| 1847 | /* End of Outputs for S-Function (rti_commonblock): '<S419>/S-Function1' */ |
| 1848 | } |
| 1849 | |
| 1850 | /* |
| 1851 | * Forced non-inlined (FNI) function call stub |
| 1852 | * for '<S417>/Tcp Input Processing' |
| 1853 | */ |
| 1854 | boolean_T L4_MABX_TcpInputProcessingFNI(RT_MODEL_L4_MABX_T *const L4_MABX_M, |
| 1855 | int_T controlPortIdx, int_T tid) |
| 1856 | { |
| 1857 | L4_MABX_TcpInputProcessing(); |
| 1858 | UNUSED_PARAMETER(L4_MABX_M); |
| 1859 | UNUSED_PARAMETER(controlPortIdx); |
| 1860 | UNUSED_PARAMETER(tid); |
| 1861 | return (1); |
| 1862 | } |
| 1863 | |
| 1864 | /* |
| 1865 | * Forced non-inlined (FNI) function call stub |
| 1866 | * for '<S417>/Tcp Input Processing' |
| 1867 | */ |
| 1868 | boolean_T L4_TcpInputProcessing_ResetFNI(RT_MODEL_L4_MABX_T *const L4_MABX_M, |
| 1869 | int_T controlPortIdx, int_T tid) |
| 1870 | { |
| 1871 | UNUSED_PARAMETER(L4_MABX_M); |
| 1872 | UNUSED_PARAMETER(controlPortIdx); |
| 1873 | UNUSED_PARAMETER(tid); |
| 1874 | return (1); |
| 1875 | } |
| 1876 | |
| 1877 | /* Termination for function-call system: '<S417>/Tcp Input Processing' */ |
| 1878 | void L4__TcpInputProcessing_Term(void) |
| 1879 | { |
| 1880 | /* Terminate for S-Function (rti_commonblock): '<S419>/S-Function1' incorporates: |
| 1881 | * SubSystem: '<S405>/IRQ_Level_2_SW_INT' |
| 1882 | */ |
| 1883 | L4__IRQ_Level_2_SW_INT_Term(); |
| 1884 | |
| 1885 | /* End of Terminate for S-Function (rti_commonblock): '<S419>/S-Function1' */ |
| 1886 | } |
| 1887 | |
| 1888 | /* System initialize for function-call system: '<S405>/Interrupt_Task' */ |
| 1889 | void L4_MABX_Interrupt_Task_Init(void) |
| 1890 | { |
| 1891 | /* InitializeConditions for S-Function (dsa_tcpip_irq_l1_sfcn): '<S417>/dsa_tcpip_irq_l1_sfcn' */ |
| 1892 | |
| 1893 | /* Level2 S-Function Block: '<S417>/dsa_tcpip_irq_l1_sfcn' (dsa_tcpip_irq_l1_sfcn) */ |
| 1894 | { |
| 1895 | SimStruct *rts = L4_MABX_M->childSfunctions[2]; |
| 1896 | sfcnInitializeConditions(rts); |
| 1897 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1898 | return; |
| 1899 | } |
| 1900 | |
| 1901 | /* End of InitializeConditions for S-Function (dsa_tcpip_irq_l1_sfcn): '<S417>/dsa_tcpip_irq_l1_sfcn' */ |
| 1902 | |
| 1903 | /* SystemInitialize for S-Function (dsa_tcpip_irq_l1_sfcn): '<S417>/dsa_tcpip_irq_l1_sfcn' incorporates: |
| 1904 | * SubSystem: '<S417>/Tcp Input Processing' |
| 1905 | */ |
| 1906 | L4__TcpInputProcessing_Init(); |
| 1907 | |
| 1908 | /* End of SystemInitialize for S-Function (dsa_tcpip_irq_l1_sfcn): '<S417>/dsa_tcpip_irq_l1_sfcn' */ |
| 1909 | } |
| 1910 | |
| 1911 | /* System reset for function-call system: '<S405>/Interrupt_Task' */ |
| 1912 | void L4_MAB_Interrupt_Task_Reset(void) |
| 1913 | { |
| 1914 | /* InitializeConditions for S-Function (dsa_tcpip_irq_l1_sfcn): '<S417>/dsa_tcpip_irq_l1_sfcn' */ |
| 1915 | |
| 1916 | /* Level2 S-Function Block: '<S417>/dsa_tcpip_irq_l1_sfcn' (dsa_tcpip_irq_l1_sfcn) */ |
| 1917 | { |
| 1918 | SimStruct *rts = L4_MABX_M->childSfunctions[2]; |
| 1919 | sfcnInitializeConditions(rts); |
| 1920 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1921 | return; |
| 1922 | } |
| 1923 | |
| 1924 | /* End of InitializeConditions for S-Function (dsa_tcpip_irq_l1_sfcn): '<S417>/dsa_tcpip_irq_l1_sfcn' */ |
| 1925 | |
| 1926 | /* SystemReset for S-Function (dsa_tcpip_irq_l1_sfcn): '<S417>/dsa_tcpip_irq_l1_sfcn' incorporates: |
| 1927 | * SubSystem: '<S417>/Tcp Input Processing' |
| 1928 | */ |
| 1929 | L4_TcpInputProcessing_Reset(); |
| 1930 | |
| 1931 | /* End of SystemReset for S-Function (dsa_tcpip_irq_l1_sfcn): '<S417>/dsa_tcpip_irq_l1_sfcn' */ |
| 1932 | } |
| 1933 | |
| 1934 | /* Start for function-call system: '<S405>/Interrupt_Task' */ |
| 1935 | void L4_MAB_Interrupt_Task_Start(void) |
| 1936 | { |
| 1937 | /* Start for S-Function (dsa_tcpip_irq_l1_sfcn): '<S417>/dsa_tcpip_irq_l1_sfcn' incorporates: |
| 1938 | * SubSystem: '<S417>/Tcp Input Processing' |
| 1939 | */ |
| 1940 | L4_TcpInputProcessing_Start(); |
| 1941 | |
| 1942 | /* Level2 S-Function Block: '<S417>/dsa_tcpip_irq_l1_sfcn' (dsa_tcpip_irq_l1_sfcn) */ |
| 1943 | { |
| 1944 | SimStruct *rts = L4_MABX_M->childSfunctions[2]; |
| 1945 | sfcnStart(rts); |
| 1946 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1947 | return; |
| 1948 | } |
| 1949 | |
| 1950 | /* End of Start for S-Function (dsa_tcpip_irq_l1_sfcn): '<S417>/dsa_tcpip_irq_l1_sfcn' */ |
| 1951 | } |
| 1952 | |
| 1953 | /* Output and update for function-call system: '<S405>/Interrupt_Task' */ |
| 1954 | void L4_MABX_Interrupt_Task(void) |
| 1955 | { |
| 1956 | /* S-Function (dsa_tcpip_irq_l1_sfcn): '<S417>/dsa_tcpip_irq_l1_sfcn' */ |
| 1957 | |
| 1958 | /* Level2 S-Function Block: '<S417>/dsa_tcpip_irq_l1_sfcn' (dsa_tcpip_irq_l1_sfcn) */ |
| 1959 | { |
| 1960 | SimStruct *rts = L4_MABX_M->childSfunctions[2]; |
| 1961 | sfcnOutputs(rts,11); |
| 1962 | } |
| 1963 | |
| 1964 | /* End of Outputs for S-Function (dsa_tcpip_irq_l1_sfcn): '<S417>/dsa_tcpip_irq_l1_sfcn' */ |
| 1965 | } |
| 1966 | |
| 1967 | /* Termination for function-call system: '<S405>/Interrupt_Task' */ |
| 1968 | void L4_MABX_Interrupt_Task_Term(void) |
| 1969 | { |
| 1970 | /* Terminate for S-Function (dsa_tcpip_irq_l1_sfcn): '<S417>/dsa_tcpip_irq_l1_sfcn' */ |
| 1971 | |
| 1972 | /* Level2 S-Function Block: '<S417>/dsa_tcpip_irq_l1_sfcn' (dsa_tcpip_irq_l1_sfcn) */ |
| 1973 | { |
| 1974 | SimStruct *rts = L4_MABX_M->childSfunctions[2]; |
| 1975 | sfcnTerminate(rts); |
| 1976 | } |
| 1977 | |
| 1978 | /* End of Terminate for S-Function (dsa_tcpip_irq_l1_sfcn): '<S417>/dsa_tcpip_irq_l1_sfcn' */ |
| 1979 | |
| 1980 | /* Terminate for S-Function (dsa_tcpip_irq_l1_sfcn): '<S417>/dsa_tcpip_irq_l1_sfcn' incorporates: |
| 1981 | * SubSystem: '<S417>/Tcp Input Processing' |
| 1982 | */ |
| 1983 | L4__TcpInputProcessing_Term(); |
| 1984 | |
| 1985 | /* End of Terminate for S-Function (dsa_tcpip_irq_l1_sfcn): '<S417>/dsa_tcpip_irq_l1_sfcn' */ |
| 1986 | } |
| 1987 | |
| 1988 | /* Output and update for atomic system: '<S750>/If_Then_Else' */ |
| 1989 | void L4_MABX_If_Then_Else_kn(boolean_T rtu_If, real_T rtu_Then, real_T rtu_Else) |
| 1990 | { |
| 1991 | /* Switch: '<S771>/Switch' */ |
| 1992 | if (rtu_If) { |
| 1993 | Pedal_pwm_position = rtu_Then; |
| 1994 | } else { |
| 1995 | Pedal_pwm_position = rtu_Else; |
| 1996 | } |
| 1997 | |
| 1998 | /* End of Switch: '<S771>/Switch' */ |
| 1999 | } |
| 2000 | |
| 2001 | /* System initialize for function-call system: '<S423>/IncrementTimer' */ |
| 2002 | void L4_MABX_IncrementTimer_Init(void) |
| 2003 | { |
| 2004 | /* InitializeConditions for UnitDelay: '<S853>/Unit_Delay' */ |
| 2005 | L4_MABX_DW.Unit_Delay_DSTATE_k = L4_MABX_P.Unit_Delay_InitialCondition_n; |
| 2006 | |
| 2007 | /* SystemInitialize for Outport: '<S853>/Out1' */ |
| 2008 | L4_MABX_B.Add = L4_MABX_P.Out1_Y0_c; |
| 2009 | } |
| 2010 | |
| 2011 | /* System reset for function-call system: '<S423>/IncrementTimer' */ |
| 2012 | void L4_MAB_IncrementTimer_Reset(void) |
| 2013 | { |
| 2014 | /* InitializeConditions for UnitDelay: '<S853>/Unit_Delay' */ |
| 2015 | L4_MABX_DW.Unit_Delay_DSTATE_k = L4_MABX_P.Unit_Delay_InitialCondition_n; |
| 2016 | } |
| 2017 | |
| 2018 | /* Output and update for function-call system: '<S423>/IncrementTimer' */ |
| 2019 | void L4_MABX_IncrementTimer(void) |
| 2020 | { |
| 2021 | /* UnitDelay: '<S853>/Unit_Delay' */ |
| 2022 | L4_MABX_B.Unit_Delay_k = L4_MABX_DW.Unit_Delay_DSTATE_k; |
| 2023 | |
| 2024 | /* Sum: '<S853>/Add' incorporates: |
| 2025 | * Constant: '<S853>/Constant1' |
| 2026 | */ |
| 2027 | L4_MABX_B.Add = L4_MABX_P.Constant1_Value_pc + L4_MABX_B.Unit_Delay_k; |
| 2028 | |
| 2029 | /* Update for UnitDelay: '<S853>/Unit_Delay' */ |
| 2030 | L4_MABX_DW.Unit_Delay_DSTATE_k = L4_MABX_B.Add; |
| 2031 | } |
| 2032 | |
| 2033 | /* |
| 2034 | * Output and update for enable system: |
| 2035 | * '<S983>/ALL_CTRL_DISABLED' |
| 2036 | * '<S983>/DEFAULT_TRQ_CTRL_MODE' |
| 2037 | * '<S983>/EXT_TRQ_CTRL_MODE_A' |
| 2038 | * '<S983>/EXT_TRQ_CTRL_MODE_B' |
| 2039 | * '<S983>/EXT_TRQ_CTRL_MODE_C' |
| 2040 | */ |
| 2041 | void L4_MABX_ALL_CTRL_DISABLED(boolean_T rtu_Enable, int32_T *rty_Out1, |
| 2042 | P_ALL_CTRL_DISABLED_L4_MABX_T *localP) |
| 2043 | { |
| 2044 | /* Outputs for Enabled SubSystem: '<S983>/ALL_CTRL_DISABLED' incorporates: |
| 2045 | * EnablePort: '<S998>/Enable' |
| 2046 | */ |
| 2047 | if (rtu_Enable) { |
| 2048 | /* SignalConversion: '<S998>/OutportBufferForOut1' incorporates: |
| 2049 | * Constant: '<S998>/Constant' |
| 2050 | */ |
| 2051 | *rty_Out1 = localP->Constant_Value; |
| 2052 | } |
| 2053 | |
| 2054 | /* End of Outputs for SubSystem: '<S983>/ALL_CTRL_DISABLED' */ |
| 2055 | } |
| 2056 | |
| 2057 | /* Output and update for atomic system: '<S1021>/If_Then_Else' */ |
| 2058 | void L4_MABX_If_Then_Else_b(boolean_T rtu_If, real_T rtu_Then, |
| 2059 | ENUM_XBR_EBI_MODE_T rtu_Then_i, ENUM_XBR_PRIORITY_T rtu_Then_a, |
| 2060 | ENUM_XBR_CONTROL_MODE_T rtu_Then_h, ENUM_XBR_PASS_THROUGH_ACTIVE_T rtu_Then_j, |
| 2061 | real_T rtu_Then_c, real_T rtu_Then_o, real_T rtu_Else, ENUM_XBR_EBI_MODE_T |
| 2062 | rtu_Else_a, ENUM_XBR_PRIORITY_T rtu_Else_d, ENUM_XBR_CONTROL_MODE_T |
| 2063 | rtu_Else_do, ENUM_XBR_PASS_THROUGH_ACTIVE_T rtu_Else_b, real_T rtu_Else_k, |
| 2064 | real_T rtu_Else_bk, B_If_Then_Else_L4_MABX_p_T *localB) |
| 2065 | { |
| 2066 | /* Switch: '<S1045>/Switch' */ |
| 2067 | if (rtu_If) { |
| 2068 | localB->XBRExternalAccelDemand = rtu_Then; |
| 2069 | localB->XBREnduranceBrakeIntegrationMod = rtu_Then_i; |
| 2070 | localB->XBRPriority = rtu_Then_a; |
| 2071 | localB->XBRControlMode = rtu_Then_h; |
| 2072 | localB->XBRPassThroughActive = rtu_Then_j; |
| 2073 | localB->XBRUrgency = rtu_Then_c; |
| 2074 | localB->XBRPassThroughEnabled = rtu_Then_o; |
| 2075 | } else { |
| 2076 | localB->XBRExternalAccelDemand = rtu_Else; |
| 2077 | localB->XBREnduranceBrakeIntegrationMod = rtu_Else_a; |
| 2078 | localB->XBRPriority = rtu_Else_d; |
| 2079 | localB->XBRControlMode = rtu_Else_do; |
| 2080 | localB->XBRPassThroughActive = rtu_Else_b; |
| 2081 | localB->XBRUrgency = rtu_Else_k; |
| 2082 | localB->XBRPassThroughEnabled = rtu_Else_bk; |
| 2083 | } |
| 2084 | |
| 2085 | /* End of Switch: '<S1045>/Switch' */ |
| 2086 | } |
| 2087 | |
| 2088 | static int32_T safe_cast_to_ENUM_XPR_CONTROL_M(int32_T input) |
| 2089 | { |
| 2090 | int32_T y; |
| 2091 | |
| 2092 | /* Initialize output value to default value for ENUM_XPR_CONTROL_MODE_T (NO_BRAKE_DEMAND) */ |
| 2093 | y = 0; |
| 2094 | if (((input >= 0) && (input <= 3)) || ((input >= 13) && (input <= 15))) { |
| 2095 | /* Set output value to input value if it is a member of ENUM_XPR_CONTROL_MODE_T */ |
| 2096 | y = input; |
| 2097 | } |
| 2098 | |
| 2099 | return y; |
| 2100 | } |
| 2101 | |
| 2102 | static int32_T safe_cast_to_ENUM_XPR_ERROR_STA(int32_T input) |
| 2103 | { |
| 2104 | int32_T y; |
| 2105 | |
| 2106 | /* Initialize output value to default value for ENUM_XPR_ERROR_STATE_T (XPR_OK) */ |
| 2107 | y = 0; |
| 2108 | if ((input >= 0) && (input <= 3)) { |
| 2109 | /* Set output value to input value if it is a member of ENUM_XPR_ERROR_STATE_T */ |
| 2110 | y = input; |
| 2111 | } |
| 2112 | |
| 2113 | return y; |
| 2114 | } |
| 2115 | |
| 2116 | /* Function for Chart: '<S211>/Relay_control_state_machine' */ |
| 2117 | static void L4_MABX_enter_atomic_INITIAL(void) |
| 2118 | { |
| 2119 | /* Entry 'INITIAL': '<S218>:12' */ |
| 2120 | L4_MABX_B.F_Ignition_relay_command_i = false; |
| 2121 | L4_MABX_B.F_Inverter_relay_command_p = false; |
| 2122 | L4_MABX_B.F_MABX_relay_command_n = false; |
| 2123 | L4_MABX_B.F_Sensor_relay_command_k = false; |
| 2124 | L4_MABX_DW.IGN_RELAY_ON_DELAY_SECS_APV = |
| 2125 | L4_MABX_B.TmpSignalConversionAtSFunctionI[0]; |
| 2126 | L4_MABX_DW.INVERTER_RELAY_ON_DELAY_SECS_AP = |
| 2127 | L4_MABX_B.TmpSignalConversionAtSFunctionI[1]; |
| 2128 | L4_MABX_DW.MABX_RELAY_ON_DELAY_SECS_APV = |
| 2129 | L4_MABX_B.TmpSignalConversionAtSFunctionI[2]; |
| 2130 | L4_MABX_DW.SENSOR_RELAY_ON_DELAY_SECS_APV = |
| 2131 | L4_MABX_B.TmpSignalConversionAtSFunctionI[3]; |
| 2132 | L4_MABX_DW.IGN_RELAY_OFF_DELAY_SECS_APV = |
| 2133 | L4_MABX_B.TmpSignalConversionAtSFunctio_k[0]; |
| 2134 | L4_MABX_DW.INVERTER_RELAY_OFF_DELAY_SECS_A = |
| 2135 | L4_MABX_B.TmpSignalConversionAtSFunctio_k[1]; |
| 2136 | L4_MABX_DW.MABX_RELAY_OFF_DELAY_SECS_APV = |
| 2137 | L4_MABX_B.TmpSignalConversionAtSFunctio_k[2]; |
| 2138 | L4_MABX_DW.SENSOR_RELAY_OFF_DELAY_SECS_APV = |
| 2139 | L4_MABX_B.TmpSignalConversionAtSFunctio_k[3]; |
| 2140 | } |
| 2141 | |
| 2142 | real_T rt_atan2d_snf(real_T u0, real_T u1) |
| 2143 | { |
| 2144 | real_T y; |
| 2145 | int32_T tmp; |
| 2146 | int32_T tmp_0; |
| 2147 | if (rtIsNaN(u0) || rtIsNaN(u1)) { |
| 2148 | y = (rtNaN); |
| 2149 | } else if (rtIsInf(u0) && rtIsInf(u1)) { |
| 2150 | if (u1 > 0.0) { |
| 2151 | tmp = 1; |
| 2152 | } else { |
| 2153 | tmp = -1; |
| 2154 | } |
| 2155 | |
| 2156 | if (u0 > 0.0) { |
| 2157 | tmp_0 = 1; |
| 2158 | } else { |
| 2159 | tmp_0 = -1; |
| 2160 | } |
| 2161 | |
| 2162 | y = atan2(tmp_0, tmp); |
| 2163 | } else if (u1 == 0.0) { |
| 2164 | if (u0 > 0.0) { |
| 2165 | y = RT_PI / 2.0; |
| 2166 | } else if (u0 < 0.0) { |
| 2167 | y = -(RT_PI / 2.0); |
| 2168 | } else { |
| 2169 | y = 0.0; |
| 2170 | } |
| 2171 | } else { |
| 2172 | y = atan2(u0, u1); |
| 2173 | } |
| 2174 | |
| 2175 | return y; |
| 2176 | } |
| 2177 | |
| 2178 | real_T rt_powd_snf(real_T u0, real_T u1) |
| 2179 | { |
| 2180 | real_T y; |
| 2181 | real_T tmp; |
| 2182 | real_T tmp_0; |
| 2183 | if (rtIsNaN(u0) || rtIsNaN(u1)) { |
| 2184 | y = (rtNaN); |
| 2185 | } else { |
| 2186 | tmp = fabs(u0); |
| 2187 | tmp_0 = fabs(u1); |
| 2188 | if (rtIsInf(u1)) { |
| 2189 | if (tmp == 1.0) { |
| 2190 | y = 1.0; |
| 2191 | } else if (tmp > 1.0) { |
| 2192 | if (u1 > 0.0) { |
| 2193 | y = (rtInf); |
| 2194 | } else { |
| 2195 | y = 0.0; |
| 2196 | } |
| 2197 | } else if (u1 > 0.0) { |
| 2198 | y = 0.0; |
| 2199 | } else { |
| 2200 | y = (rtInf); |
| 2201 | } |
| 2202 | } else if (tmp_0 == 0.0) { |
| 2203 | y = 1.0; |
| 2204 | } else if (tmp_0 == 1.0) { |
| 2205 | if (u1 > 0.0) { |
| 2206 | y = u0; |
| 2207 | } else { |
| 2208 | y = 1.0 / u0; |
| 2209 | } |
| 2210 | } else if (u1 == 2.0) { |
| 2211 | y = u0 * u0; |
| 2212 | } else if ((u1 == 0.5) && (u0 >= 0.0)) { |
| 2213 | y = sqrt(u0); |
| 2214 | } else if ((u0 < 0.0) && (u1 > floor(u1))) { |
| 2215 | y = (rtNaN); |
| 2216 | } else { |
| 2217 | y = pow(u0, u1); |
| 2218 | } |
| 2219 | } |
| 2220 | |
| 2221 | return y; |
| 2222 | } |
| 2223 | |
| 2224 | /* Function for Chart: '<S350>/VehicleSpeedSetpointDynamicCalculation' */ |
| 2225 | static void L4_MABX_Calculate_abc(void) |
| 2226 | { |
| 2227 | /* MATLAB Function 'Calculate_abc': '<S365>:158' */ |
| 2228 | /* Graphical Function 'Calculate_abc': '<S365>:158' */ |
| 2229 | /* '<S365>:160:1' */ |
| 2230 | L4_MABX_DW.a = L4_MABX_DW.Jerk56 - L4_MABX_DW.Jerk12; |
| 2231 | |
| 2232 | /* '<S365>:160:1' */ |
| 2233 | L4_MABX_DW.b = ((L4_MABX_DW.AccelerationFinalLimited * L4_MABX_DW.Jerk12 - |
| 2234 | L4_MABX_DW.AccelerationInitialLimited * L4_MABX_DW.Jerk56) - |
| 2235 | L4_MABX_DW.Jerk12 * L4_MABX_DW.Jerk56 * L4_MABX_DW.TimeFinal) * |
| 2236 | 2.0; |
| 2237 | |
| 2238 | /* '<S365>:160:3' */ |
| 2239 | L4_MABX_DW.c = (2.0 * L4_MABX_DW.Jerk12 * L4_MABX_DW.Jerk56 * |
| 2240 | (L4_MABX_DW.VelocityFinalLimited - |
| 2241 | L4_MABX_DW.VelocityInitialLimited) + |
| 2242 | L4_MABX_DW.AccelerationInitialLimited * |
| 2243 | L4_MABX_DW.AccelerationInitialLimited * L4_MABX_DW.Jerk56) - |
| 2244 | L4_MABX_DW.AccelerationFinalLimited * L4_MABX_DW.AccelerationFinalLimited * |
| 2245 | L4_MABX_DW.Jerk12; |
| 2246 | } |
| 2247 | |
| 2248 | /* Function for Chart: '<S350>/VehicleSpeedSetpointDynamicCalculation' */ |
| 2249 | static void L4_MABX_CalculateAlternate_abc(void) |
| 2250 | { |
| 2251 | /* MATLAB Function 'CalculateAlternate_abc': '<S365>:286' */ |
| 2252 | /* Graphical Function 'CalculateAlternate_abc': '<S365>:286' */ |
| 2253 | /* '<S365>:285:1' */ |
| 2254 | L4_MABX_DW.a = 1.0; |
| 2255 | |
| 2256 | /* '<S365>:285:1' */ |
| 2257 | L4_MABX_DW.b = ((L4_MABX_DW.TimeFinal - 0.005) * L4_MABX_DW.Jerk56 - |
| 2258 | L4_MABX_DW.AccelerationFinalLimited) * 2.0; |
| 2259 | |
| 2260 | /* '<S365>:285:3' */ |
| 2261 | L4_MABX_DW.c = 2.0 * L4_MABX_DW.Jerk56 * (L4_MABX_DW.VelocityInitialLimited - |
| 2262 | L4_MABX_DW.VelocityFinalLimited) + L4_MABX_DW.AccelerationFinalLimited * |
| 2263 | L4_MABX_DW.AccelerationFinalLimited; |
| 2264 | } |
| 2265 | |
| 2266 | /* Function for Chart: '<S350>/VehicleSpeedSetpointDynamicCalculation' */ |
| 2267 | static void L4_MABX_CalculateAcceleration34(void) |
| 2268 | { |
| 2269 | real_T u; |
| 2270 | real_T u0; |
| 2271 | real_T u1; |
| 2272 | |
| 2273 | /* MATLAB Function 'CalculateAcceleration34': '<S365>:167' */ |
| 2274 | /* Graphical Function 'CalculateAcceleration34': '<S365>:167' */ |
| 2275 | /* '<S365>:186:1' */ |
| 2276 | /* '<S365>:186:5' */ |
| 2277 | /* '<S365>:186:8' */ |
| 2278 | u = L4_MABX_DW.Jerk12; |
| 2279 | if (u < 0.0) { |
| 2280 | u = -1.0; |
| 2281 | } else if (u > 0.0) { |
| 2282 | u = 1.0; |
| 2283 | } else if (u == 0.0) { |
| 2284 | u = 0.0; |
| 2285 | } else { |
| 2286 | u = (rtNaN); |
| 2287 | } |
| 2288 | |
| 2289 | u0 = fabs(L4_MABX_DW.Jerk12); |
| 2290 | u1 = fabs(((((L4_MABX_DW.AccelerationInitialLimited * |
| 2291 | L4_MABX_DW.AccelerationFinalLimited - |
| 2292 | L4_MABX_DW.AccelerationInitialLimited * L4_MABX_DW.Jerk56 * |
| 2293 | L4_MABX_DW.TimeFinal) + (L4_MABX_DW.VelocityFinalLimited - |
| 2294 | L4_MABX_DW.VelocityInitialLimited) * L4_MABX_DW.Jerk56) * 2.0 - |
| 2295 | L4_MABX_DW.AccelerationInitialLimited * |
| 2296 | L4_MABX_DW.AccelerationInitialLimited) - |
| 2297 | L4_MABX_DW.AccelerationFinalLimited * |
| 2298 | L4_MABX_DW.AccelerationFinalLimited) / |
| 2299 | (((L4_MABX_DW.VelocityFinalLimited - |
| 2300 | L4_MABX_DW.VelocityInitialLimited) - |
| 2301 | L4_MABX_DW.AccelerationFinalLimited * L4_MABX_DW.TimeFinal) * 2.0 |
| 2302 | + L4_MABX_DW.TimeFinal * L4_MABX_DW.TimeFinal * L4_MABX_DW.Jerk56)) |
| 2303 | + 0.001; |
| 2304 | if ((u0 > u1) || rtIsNaN(u1)) { |
| 2305 | u1 = u0; |
| 2306 | } |
| 2307 | |
| 2308 | L4_MABX_DW.Jerk12 = u * u1; |
| 2309 | |
| 2310 | /* '<S365>:186:11' */ |
| 2311 | u1 = L4_MABX_DW.Jerk12; |
| 2312 | if ((10.0 < u1) || rtIsNaN(u1)) { |
| 2313 | u1 = 10.0; |
| 2314 | } |
| 2315 | |
| 2316 | if ((-10.0 > u1) || rtIsNaN(u1)) { |
| 2317 | L4_MABX_DW.Jerk12 = -10.0; |
| 2318 | } else { |
| 2319 | L4_MABX_DW.Jerk12 = u1; |
| 2320 | } |
| 2321 | |
| 2322 | /* '<S365>:186:11' */ |
| 2323 | L4_MABX_Calculate_abc(); |
| 2324 | |
| 2325 | /* '<S365>:187:1' */ |
| 2326 | if (fabs(L4_MABX_DW.a) < 0.01) { |
| 2327 | /* '<S365>:188:1' */ |
| 2328 | L4_MABX_DW.Jerk12 = L4_MABX_DW.Jerk56; |
| 2329 | |
| 2330 | /* '<S365>:188:1' */ |
| 2331 | L4_MABX_Calculate_abc(); |
| 2332 | |
| 2333 | /* '<S365>:188:1' */ |
| 2334 | L4_MABX_DW.Acceleration34 = -L4_MABX_DW.c / L4_MABX_DW.b; |
| 2335 | |
| 2336 | /* '<S365>:188:2' */ |
| 2337 | L4_MABX_DW.AlternateMethod = false; |
| 2338 | } else { |
| 2339 | /* '<S365>:224:1' */ |
| 2340 | if (L4_MABX_DW.b * L4_MABX_DW.b <= 4.0 * L4_MABX_DW.a * L4_MABX_DW.c) { |
| 2341 | /* '<S365>:292:1' */ |
| 2342 | L4_MABX_CalculateAlternate_abc(); |
| 2343 | |
| 2344 | /* '<S365>:292:1' */ |
| 2345 | L4_MABX_DW.Acceleration34 = -L4_MABX_DW.b / (2.0 * L4_MABX_DW.a); |
| 2346 | |
| 2347 | /* '<S365>:292:2' */ |
| 2348 | L4_MABX_DW.AlternateMethod = true; |
| 2349 | } else { |
| 2350 | /* '<S365>:294:1' */ |
| 2351 | L4_MABX_DW.Acceleration34 = (sqrt(L4_MABX_DW.b * L4_MABX_DW.b - 4.0 * |
| 2352 | L4_MABX_DW.a * L4_MABX_DW.c) + -L4_MABX_DW.b) / (2.0 * L4_MABX_DW.a); |
| 2353 | |
| 2354 | /* '<S365>:294:2' */ |
| 2355 | L4_MABX_DW.AlternateMethod = false; |
| 2356 | } |
| 2357 | } |
| 2358 | } |
| 2359 | |
| 2360 | static int32_T safe_cast_to_ENUM_CAN_STATUS_DI(int32_T input) |
| 2361 | { |
| 2362 | int32_T y; |
| 2363 | |
| 2364 | /* Initialize output value to default value for ENUM_CAN_STATUS_DIAG_T (ACTIVE) */ |
| 2365 | y = 0; |
| 2366 | if ((input >= 0) && (input <= 2)) { |
| 2367 | /* Set output value to input value if it is a member of ENUM_CAN_STATUS_DIAG_T */ |
| 2368 | y = input; |
| 2369 | } |
| 2370 | |
| 2371 | return y; |
| 2372 | } |
| 2373 | |
| 2374 | /* Model output function for TID0 */ |
| 2375 | void L4_MABX_output0(void) /* Sample time: [0.01s, 0.0s] */ |
| 2376 | { |
| 2377 | int_T tid = 0; |
| 2378 | uint8_T starting_index; |
| 2379 | real_T AccelerationAverage; |
| 2380 | real_T DeltaTimeFinal; |
| 2381 | uint8_T j; |
| 2382 | real_T PositionFinalLimited; |
| 2383 | real_T Time56; |
| 2384 | real_T DeltaTime; |
| 2385 | uint32_T tmp; |
| 2386 | boolean_T zcEvent; |
| 2387 | int32_T i; |
| 2388 | uint32_T q0; |
| 2389 | uint16_T tmp_0; |
| 2390 | int8_T tmp_1; |
| 2391 | |
| 2392 | /* Update the flag to indicate when data transfers from |
| 2393 | * Sample time: [0.01s, 0.0s] to Sample time: [0.02s, 0.0s] */ |
| 2394 | L4_MABX_M->Timing.perTaskSampleHits[1] = |
| 2395 | (L4_MABX_M->Timing.RateInteraction.TID0_1 == 0); |
| 2396 | (L4_MABX_M->Timing.RateInteraction.TID0_1)++; |
| 2397 | if ((L4_MABX_M->Timing.RateInteraction.TID0_1) > 1) { |
| 2398 | L4_MABX_M->Timing.RateInteraction.TID0_1 = 0; |
| 2399 | } |
| 2400 | |
| 2401 | /* Update the flag to indicate when data transfers from |
| 2402 | * Sample time: [0.01s, 0.0s] to Sample time: [0.05s, 0.0s] */ |
| 2403 | L4_MABX_M->Timing.perTaskSampleHits[2] = |
| 2404 | (L4_MABX_M->Timing.RateInteraction.TID0_2 == 0); |
| 2405 | (L4_MABX_M->Timing.RateInteraction.TID0_2)++; |
| 2406 | if ((L4_MABX_M->Timing.RateInteraction.TID0_2) > 4) { |
| 2407 | L4_MABX_M->Timing.RateInteraction.TID0_2 = 0; |
| 2408 | } |
| 2409 | |
| 2410 | /* Update the flag to indicate when data transfers from |
| 2411 | * Sample time: [0.01s, 0.0s] to Sample time: [0.1s, 0.0s] */ |
| 2412 | L4_MABX_M->Timing.perTaskSampleHits[3] = |
| 2413 | (L4_MABX_M->Timing.RateInteraction.TID0_3 == 0); |
| 2414 | (L4_MABX_M->Timing.RateInteraction.TID0_3)++; |
| 2415 | if ((L4_MABX_M->Timing.RateInteraction.TID0_3) > 9) { |
| 2416 | L4_MABX_M->Timing.RateInteraction.TID0_3 = 0; |
| 2417 | } |
| 2418 | |
| 2419 | /* Update the flag to indicate when data transfers from |
| 2420 | * Sample time: [0.01s, 0.0s] to Sample time: [1.0s, 0.0s] */ |
| 2421 | L4_MABX_M->Timing.perTaskSampleHits[6] = |
| 2422 | (L4_MABX_M->Timing.RateInteraction.TID0_6 == 0); |
| 2423 | (L4_MABX_M->Timing.RateInteraction.TID0_6)++; |
| 2424 | if ((L4_MABX_M->Timing.RateInteraction.TID0_6) > 99) { |
| 2425 | L4_MABX_M->Timing.RateInteraction.TID0_6 = 0; |
| 2426 | } |
| 2427 | |
| 2428 | /* Update the flag to indicate when data transfers from |
| 2429 | * Sample time: [0.01s, 0.0s] to Sample time: [5.0s, 0.0s] */ |
| 2430 | L4_MABX_M->Timing.perTaskSampleHits[7] = |
| 2431 | (L4_MABX_M->Timing.RateInteraction.TID0_7 == 0); |
| 2432 | (L4_MABX_M->Timing.RateInteraction.TID0_7)++; |
| 2433 | if ((L4_MABX_M->Timing.RateInteraction.TID0_7) > 499) { |
| 2434 | L4_MABX_M->Timing.RateInteraction.TID0_7 = 0; |
| 2435 | } |
| 2436 | |
| 2437 | /* Outputs for Enabled SubSystem: '<S503>/AIR1' incorporates: |
| 2438 | * EnablePort: '<S504>/Enable' |
| 2439 | */ |
| 2440 | /* Constant: '<S431>/Constant' */ |
| 2441 | if (L4_MABX_P.Constant_Value_b0) { |
| 2442 | /* S-Function (rti_commonblock): '<S504>/S-Function1' */ |
| 2443 | /* This comment workarounds a code generation problem */ |
| 2444 | |
| 2445 | /* dSPACE RTICAN RX Message Block: "AIR1" Id:419343921 */ |
| 2446 | { |
| 2447 | UInt32 *CAN_Msg; |
| 2448 | static dsfloat time_old = 0.0; |
| 2449 | |
| 2450 | /* Read status and timestamp info (previous message) */ |
| 2451 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEAE31].timestamp != |
| 2452 | time_old) { |
| 2453 | /* ... save timestamp info for the calculation of the RX status |
| 2454 | during the consecutive sample hit*/ |
| 2455 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEAE31]. |
| 2456 | timestamp; |
| 2457 | |
| 2458 | /* ... set the processed flag to one */ |
| 2459 | L4_MABX_B.SFunction1_o9_kh = 1.0; |
| 2460 | L4_MABX_B.SFunction1_o10_dt = (real_T) |
| 2461 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEAE31].timestamp; |
| 2462 | L4_MABX_B.SFunction1_o11_a3 = (real_T) |
| 2463 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEAE31].deltatime; |
| 2464 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEAE31].data; |
| 2465 | |
| 2466 | /* Decode CAN message */ |
| 2467 | { |
| 2468 | { |
| 2469 | rtican_Signal_t CAN_Sgn; |
| 2470 | |
| 2471 | /* ...... "PneumaticSupplyPress" (0|8, standard signal, unsigned int, little endian) */ |
| 2472 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 2473 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2474 | L4_MABX_B.SFunction1_o1_fw = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2475 | |
| 2476 | /* ...... "ParkingAnd_orTrailerAirPress" (8|8, standard signal, unsigned int, little endian) */ |
| 2477 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 2478 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2479 | L4_MABX_B.SFunction1_o2_ey = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2480 | |
| 2481 | /* ...... "ServiceBrakeCircuit1AirPress" (16|8, standard signal, unsigned int, little endian) */ |
| 2482 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 2483 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2484 | L4_MABX_B.SFunction1_o3_j1 = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2485 | |
| 2486 | /* ...... "ServiceBrakeCircuit2AirPress" (24|8, standard signal, unsigned int, little endian) */ |
| 2487 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 2488 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2489 | L4_MABX_B.SFunction1_o4_kv = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2490 | |
| 2491 | /* ...... "AuxEquipmentSupplyPress" (32|8, standard signal, unsigned int, little endian) */ |
| 2492 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 2493 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2494 | L4_MABX_B.SFunction1_o5_ki = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2495 | |
| 2496 | /* ...... "AirSuspensionSupplyPress" (40|8, standard signal, unsigned int, little endian) */ |
| 2497 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 2498 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2499 | L4_MABX_B.SFunction1_o6_jl = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2500 | |
| 2501 | /* ...... "AirCompressorStatus" (48|2, standard signal, unsigned int, little endian) */ |
| 2502 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 2503 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 2504 | L4_MABX_B.SFunction1_o7_hj = ((real_T) CAN_Sgn.UnsignedSgn); |
| 2505 | |
| 2506 | /* ...... "PowertrainCircuitAirSupplyPress" (56|8, standard signal, unsigned int, little endian) */ |
| 2507 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 2508 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2509 | L4_MABX_B.SFunction1_o8_fg = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2510 | } |
| 2511 | } |
| 2512 | } else { |
| 2513 | /* set RX status to 0 because no new message has arrived */ |
| 2514 | L4_MABX_B.SFunction1_o9_kh = 0.0; |
| 2515 | } |
| 2516 | } |
| 2517 | } |
| 2518 | |
| 2519 | /* End of Constant: '<S431>/Constant' */ |
| 2520 | /* End of Outputs for SubSystem: '<S503>/AIR1' */ |
| 2521 | |
| 2522 | /* Outputs for Enabled SubSystem: '<S505>/AMB' incorporates: |
| 2523 | * EnablePort: '<S506>/Enable' |
| 2524 | */ |
| 2525 | /* Constant: '<S432>/Constant' */ |
| 2526 | if (L4_MABX_P.Constant_Value_bu) { |
| 2527 | /* S-Function (rti_commonblock): '<S506>/S-Function1' */ |
| 2528 | /* This comment workarounds a code generation problem */ |
| 2529 | |
| 2530 | /* dSPACE RTICAN RX Message Block: "AMB" Id:419362048 */ |
| 2531 | { |
| 2532 | UInt32 *CAN_Msg; |
| 2533 | static dsfloat time_old = 0.0; |
| 2534 | |
| 2535 | /* Read status and timestamp info (previous message) */ |
| 2536 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF500].timestamp != |
| 2537 | time_old) { |
| 2538 | /* ... save timestamp info for the calculation of the RX status |
| 2539 | during the consecutive sample hit*/ |
| 2540 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF500]. |
| 2541 | timestamp; |
| 2542 | |
| 2543 | /* ... set the processed flag to one */ |
| 2544 | L4_MABX_B.SFunction1_o6_j0 = 1.0; |
| 2545 | L4_MABX_B.SFunction1_o7_m = (real_T) |
| 2546 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF500].timestamp; |
| 2547 | L4_MABX_B.SFunction1_o8_i = (real_T) |
| 2548 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF500].deltatime; |
| 2549 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF500].data; |
| 2550 | |
| 2551 | /* Decode CAN message */ |
| 2552 | { |
| 2553 | { |
| 2554 | rtican_Signal_t CAN_Sgn; |
| 2555 | |
| 2556 | /* ...... "BarometricPress" (0|8, standard signal, unsigned int, little endian) */ |
| 2557 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 2558 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2559 | L4_MABX_B.SFunction1_o1_a5 = 0.5 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2560 | |
| 2561 | /* ...... "CabInteriorTemp" (8|16, standard signal, unsigned int, little endian) */ |
| 2562 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 2563 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 2564 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 2565 | L4_MABX_B.SFunction1_o2_f2 = -273 + ( 0.03125 * ( ((real_T) |
| 2566 | CAN_Sgn.UnsignedSgn) ) ); |
| 2567 | |
| 2568 | /* ...... "AmbientAirTemp" (24|16, standard signal, unsigned int, little endian) */ |
| 2569 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 2570 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 2571 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 2572 | L4_MABX_B.SFunction1_o3_fp = -273 + ( 0.03125 * ( ((real_T) |
| 2573 | CAN_Sgn.UnsignedSgn) ) ); |
| 2574 | |
| 2575 | /* ...... "EngAirIntakeTemp" (40|8, standard signal, unsigned int, little endian) */ |
| 2576 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 2577 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2578 | L4_MABX_B.SFunction1_o4_i0 = -40 + ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2579 | |
| 2580 | /* ...... "RoadSurfaceTemp" (48|16, standard signal, unsigned int, little endian) */ |
| 2581 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 2582 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[7]; |
| 2583 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 2584 | L4_MABX_B.SFunction1_o5_gk = -273 + ( 0.03125 * ( ((real_T) |
| 2585 | CAN_Sgn.UnsignedSgn) ) ); |
| 2586 | } |
| 2587 | } |
| 2588 | } else { |
| 2589 | /* set RX status to 0 because no new message has arrived */ |
| 2590 | L4_MABX_B.SFunction1_o6_j0 = 0.0; |
| 2591 | } |
| 2592 | } |
| 2593 | } |
| 2594 | |
| 2595 | /* End of Constant: '<S432>/Constant' */ |
| 2596 | /* End of Outputs for SubSystem: '<S505>/AMB' */ |
| 2597 | |
| 2598 | /* Outputs for Atomic SubSystem: '<S855>/CAN_TX_1000ms' */ |
| 2599 | |
| 2600 | /* RateTransition: '<S875>/TmpRTBAtAIR1Inport1' */ |
| 2601 | if (L4_MABX_M->Timing.RateInteraction.TID0_6 == 1) { |
| 2602 | L4_MABX_B.PneumaticSupplyPress = L4_MABX_B.SFunction1_o1_fw; |
| 2603 | L4_MABX_B.ParkingAnd_orTrailerAirPress = L4_MABX_B.SFunction1_o2_ey; |
| 2604 | L4_MABX_B.ServiceBrakeCircuit1AirPress = L4_MABX_B.SFunction1_o3_j1; |
| 2605 | L4_MABX_B.ServiceBrakeCircuit2AirPress = L4_MABX_B.SFunction1_o4_kv; |
| 2606 | L4_MABX_B.AuxEquipmentSupplyPress = L4_MABX_B.SFunction1_o5_ki; |
| 2607 | L4_MABX_B.AirSuspensionSupplyPress = L4_MABX_B.SFunction1_o6_jl; |
| 2608 | L4_MABX_B.AirCompressorStatus = L4_MABX_B.SFunction1_o7_hj; |
| 2609 | L4_MABX_B.PowertrainCircuitAirSupplyPress = L4_MABX_B.SFunction1_o8_fg; |
| 2610 | L4_MABX_B.BarometricPress_p = L4_MABX_B.SFunction1_o1_a5; |
| 2611 | L4_MABX_B.CabInteriorTemp = L4_MABX_B.SFunction1_o2_f2; |
| 2612 | L4_MABX_B.AmbientAirTemp_a = L4_MABX_B.SFunction1_o3_fp; |
| 2613 | L4_MABX_B.EngAirIntakeTemp = L4_MABX_B.SFunction1_o4_i0; |
| 2614 | L4_MABX_B.RoadSurfaceTemp = L4_MABX_B.SFunction1_o5_gk; |
| 2615 | } |
| 2616 | |
| 2617 | /* End of Outputs for SubSystem: '<S855>/CAN_TX_1000ms' */ |
| 2618 | |
| 2619 | /* S-Function (rti_commonblock): '<S740>/S-Function1' */ |
| 2620 | /* This comment workarounds a code generation problem */ |
| 2621 | |
| 2622 | /* DataTypeConversion: '<S422>/EStopSwActive' */ |
| 2623 | L4_MABX_B.EStopSwActive = L4_MABX_B.SFunction1_n3; |
| 2624 | |
| 2625 | /* Logic: '<S422>/Logical Operator1' */ |
| 2626 | EStop = !L4_MABX_B.EStopSwActive; |
| 2627 | |
| 2628 | /* S-Function (rti_commonblock): '<S739>/S-Function1' */ |
| 2629 | /* This comment workarounds a code generation problem */ |
| 2630 | |
| 2631 | /* S-Function (sfix_bitop): '<S849>/Operator' */ |
| 2632 | L4_MABX_B.Operator_ck = (L4_MABX_B.SFunction1_k && |
| 2633 | (L4_MABX_P.Operator_BitMask_p2 != 0)); |
| 2634 | |
| 2635 | /* DataTypeConversion: '<S849>/DataType' */ |
| 2636 | L4_MABX_B.DataType_pt = L4_MABX_B.Operator_ck; |
| 2637 | |
| 2638 | /* Logic: '<S751>/Logical Operator' */ |
| 2639 | L4_MABX_B.LogicalOperator = !L4_MABX_B.DataType_pt; |
| 2640 | |
| 2641 | /* S-Function (rti_commonblock): '<S741>/S-Function1' */ |
| 2642 | /* This comment workarounds a code generation problem */ |
| 2643 | |
| 2644 | /* S-Function (sfix_bitop): '<S850>/Operator' */ |
| 2645 | L4_MABX_B.Operator_blr = (L4_MABX_B.SFunction1_j && |
| 2646 | (L4_MABX_P.Operator_BitMask_hk != 0)); |
| 2647 | |
| 2648 | /* DataTypeConversion: '<S850>/DataType' */ |
| 2649 | L4_MABX_B.DataType_p0 = L4_MABX_B.Operator_blr; |
| 2650 | |
| 2651 | /* Logic: '<S751>/AND2' */ |
| 2652 | L4_MABX_B.AND2 = (L4_MABX_B.LogicalOperator && L4_MABX_B.DataType_p0); |
| 2653 | |
| 2654 | /* Chart: '<S851>/Chart' */ |
| 2655 | /* Gateway: DIGITAL/Signal Check/RationalityCheck/Chart */ |
| 2656 | /* During: DIGITAL/Signal Check/RationalityCheck/Chart */ |
| 2657 | if (L4_MABX_DW.is_active_c5_SUB_ECU_L4_MABX_HW == 0U) { |
| 2658 | /* Entry: DIGITAL/Signal Check/RationalityCheck/Chart */ |
| 2659 | L4_MABX_DW.is_active_c5_SUB_ECU_L4_MABX_HW = 1U; |
| 2660 | |
| 2661 | /* Entry Internal: DIGITAL/Signal Check/RationalityCheck/Chart */ |
| 2662 | /* Transition: '<S852>:6' */ |
| 2663 | L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_init_p; |
| 2664 | |
| 2665 | /* Entry 'init': '<S852>:1' */ |
| 2666 | L4_MABX_B.DiagPassed = false; |
| 2667 | } else { |
| 2668 | switch (L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf) { |
| 2669 | case L4_MABX_IN_DiagPassed: |
| 2670 | /* During 'DiagPassed': '<S852>:4' */ |
| 2671 | break; |
| 2672 | |
| 2673 | case L4_MABX_IN_SwitchOff: |
| 2674 | /* During 'SwitchOff': '<S852>:2' */ |
| 2675 | if (L4_MABX_B.AND2) { |
| 2676 | /* Transition: '<S852>:8' */ |
| 2677 | L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_DiagPassed; |
| 2678 | |
| 2679 | /* Entry 'DiagPassed': '<S852>:4' */ |
| 2680 | L4_MABX_B.DiagPassed = true; |
| 2681 | } |
| 2682 | break; |
| 2683 | |
| 2684 | case L4_MABX_IN_SwitchOn: |
| 2685 | /* During 'SwitchOn': '<S852>:3' */ |
| 2686 | if (!L4_MABX_B.AND2) { |
| 2687 | /* Transition: '<S852>:9' */ |
| 2688 | L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SwitchOff; |
| 2689 | } |
| 2690 | break; |
| 2691 | |
| 2692 | default: |
| 2693 | /* During 'init': '<S852>:1' */ |
| 2694 | if (!L4_MABX_B.AND2) { |
| 2695 | /* Transition: '<S852>:5' */ |
| 2696 | L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SwitchOff; |
| 2697 | } else { |
| 2698 | /* Transition: '<S852>:7' */ |
| 2699 | L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SwitchOn; |
| 2700 | } |
| 2701 | break; |
| 2702 | } |
| 2703 | } |
| 2704 | |
| 2705 | /* End of Chart: '<S851>/Chart' */ |
| 2706 | |
| 2707 | /* Switch: '<S751>/Switch' incorporates: |
| 2708 | * Constant: '<S751>/OverrideOperatorEnableSW_Default' |
| 2709 | */ |
| 2710 | if (L4_MABX_B.DiagPassed) { |
| 2711 | EnableSw = L4_MABX_B.AND2; |
| 2712 | } else { |
| 2713 | EnableSw = L4_MABX_P.OverrideOperatorEnableSW_Defaul; |
| 2714 | } |
| 2715 | |
| 2716 | /* End of Switch: '<S751>/Switch' */ |
| 2717 | |
| 2718 | /* UnitDelay: '<S763>/Unit Delay' */ |
| 2719 | L4_MABX_B.UnitDelay = L4_MABX_DW.UnitDelay_DSTATE; |
| 2720 | |
| 2721 | /* S-Function (rti_commonblock): '<S742>/S-Function1' */ |
| 2722 | /* This comment workarounds a code generation problem */ |
| 2723 | |
| 2724 | /* DataTypeConversion: '<S422>/StartPBActive' */ |
| 2725 | L4_MABX_B.StartPBActive = L4_MABX_B.SFunction1_l; |
| 2726 | |
| 2727 | /* Logic: '<S422>/Logical Operator' */ |
| 2728 | L4_MABX_B.LogicalOperator_g = !L4_MABX_B.StartPBActive; |
| 2729 | |
| 2730 | /* RelationalOperator: '<S765>/Compare' incorporates: |
| 2731 | * Constant: '<S765>/Constant' |
| 2732 | */ |
| 2733 | L4_MABX_B.Compare = ((int32_T)L4_MABX_B.LogicalOperator_g > (int32_T) |
| 2734 | L4_MABX_P.Constant_Value_ju); |
| 2735 | |
| 2736 | /* UnitDelay: '<S761>/Delay Input1' */ |
| 2737 | L4_MABX_B.Uk1_p = L4_MABX_DW.DelayInput1_DSTATE_i; |
| 2738 | |
| 2739 | /* RelationalOperator: '<S761>/FixPt Relational Operator' */ |
| 2740 | L4_MABX_B.FixPtRelationalOperator = ((int32_T)L4_MABX_B.Compare > (int32_T) |
| 2741 | L4_MABX_B.Uk1_p); |
| 2742 | |
| 2743 | /* UnitDelay: '<S762>/Unit Delay' */ |
| 2744 | L4_MABX_B.UnitDelay_k = L4_MABX_DW.UnitDelay_DSTATE_i; |
| 2745 | |
| 2746 | /* UnitDelay: '<S749>/Unit Delay' */ |
| 2747 | L4_MABX_B.UnitDelay_b2 = L4_MABX_DW.UnitDelay_DSTATE_ix; |
| 2748 | |
| 2749 | /* RelationalOperator: '<S764>/Compare' incorporates: |
| 2750 | * Constant: '<S764>/Constant' |
| 2751 | */ |
| 2752 | L4_MABX_B.Compare_p = ((int32_T)L4_MABX_B.UnitDelay_b2 <= (int32_T) |
| 2753 | L4_MABX_P.Constant_Value_h3i); |
| 2754 | |
| 2755 | /* UnitDelay: '<S760>/Delay Input1' */ |
| 2756 | L4_MABX_B.Uk1_e = L4_MABX_DW.DelayInput1_DSTATE_i5; |
| 2757 | |
| 2758 | /* RelationalOperator: '<S760>/FixPt Relational Operator' */ |
| 2759 | L4_MABX_B.FixPtRelationalOperator_n = ((int32_T)L4_MABX_B.Compare_p > (int32_T) |
| 2760 | L4_MABX_B.Uk1_e); |
| 2761 | |
| 2762 | /* UnitDelay: '<S762>/Unit Delay1' */ |
| 2763 | L4_MABX_B.UnitDelay1_c = L4_MABX_DW.UnitDelay1_DSTATE_p; |
| 2764 | |
| 2765 | /* Logic: '<S762>/OR1' */ |
| 2766 | L4_MABX_B.OR1 = (L4_MABX_B.FixPtRelationalOperator_n || L4_MABX_B.UnitDelay1_c); |
| 2767 | |
| 2768 | /* Switch: '<S762>/Switch' incorporates: |
| 2769 | * Constant: '<S762>/Constant0' |
| 2770 | */ |
| 2771 | if (L4_MABX_B.OR1) { |
| 2772 | /* Sum: '<S762>/Sum' incorporates: |
| 2773 | * Constant: '<S762>/Constant1' |
| 2774 | */ |
| 2775 | L4_MABX_B.Sum_f = L4_MABX_B.UnitDelay_k + L4_MABX_P.Constant1_Value_pw; |
| 2776 | L4_MABX_B.Switch = L4_MABX_B.Sum_f; |
| 2777 | } else { |
| 2778 | L4_MABX_B.Switch = L4_MABX_P.Constant0_Value_e; |
| 2779 | } |
| 2780 | |
| 2781 | /* End of Switch: '<S762>/Switch' */ |
| 2782 | |
| 2783 | /* RelationalOperator: '<S766>/Compare' incorporates: |
| 2784 | * Constant: '<S766>/Constant' |
| 2785 | */ |
| 2786 | L4_MABX_B.Compare_e = (L4_MABX_B.Switch > L4_MABX_P.Constant_Value_hg); |
| 2787 | |
| 2788 | /* Gain: '<S762>/Gain' incorporates: |
| 2789 | * Constant: '<S422>/Constant3' |
| 2790 | */ |
| 2791 | L4_MABX_B.Gain = L4_MABX_P.Gain_Gain_l * L4_MABX_P.Constant3_Value_ga; |
| 2792 | |
| 2793 | /* RelationalOperator: '<S762>/LessThanOrEqual' */ |
| 2794 | L4_MABX_B.LessThanOrEqual = (L4_MABX_B.Switch <= L4_MABX_B.Gain); |
| 2795 | |
| 2796 | /* Logic: '<S762>/AND' */ |
| 2797 | L4_MABX_B.AND = (L4_MABX_B.Compare_e && L4_MABX_B.LessThanOrEqual); |
| 2798 | |
| 2799 | /* Logic: '<S749>/NOT' */ |
| 2800 | L4_MABX_B.NOT = !L4_MABX_B.AND; |
| 2801 | |
| 2802 | /* Logic: '<S749>/AND' */ |
| 2803 | L4_MABX_B.AND_n = (L4_MABX_B.FixPtRelationalOperator && L4_MABX_B.NOT); |
| 2804 | |
| 2805 | /* UnitDelay: '<S763>/Unit Delay1' */ |
| 2806 | L4_MABX_B.UnitDelay1_l = L4_MABX_DW.UnitDelay1_DSTATE_h; |
| 2807 | |
| 2808 | /* Logic: '<S763>/OR1' */ |
| 2809 | L4_MABX_B.OR1_m = (L4_MABX_B.AND_n || L4_MABX_B.UnitDelay1_l); |
| 2810 | |
| 2811 | /* Switch: '<S763>/Switch' incorporates: |
| 2812 | * Constant: '<S763>/Constant0' |
| 2813 | */ |
| 2814 | if (L4_MABX_B.OR1_m) { |
| 2815 | /* Sum: '<S763>/Sum' incorporates: |
| 2816 | * Constant: '<S763>/Constant1' |
| 2817 | */ |
| 2818 | L4_MABX_B.Sum = L4_MABX_B.UnitDelay + L4_MABX_P.Constant1_Value_o0; |
| 2819 | L4_MABX_B.Switch_j = L4_MABX_B.Sum; |
| 2820 | } else { |
| 2821 | L4_MABX_B.Switch_j = L4_MABX_P.Constant0_Value_g; |
| 2822 | } |
| 2823 | |
| 2824 | /* End of Switch: '<S763>/Switch' */ |
| 2825 | |
| 2826 | /* RelationalOperator: '<S767>/Compare' incorporates: |
| 2827 | * Constant: '<S767>/Constant' |
| 2828 | */ |
| 2829 | L4_MABX_B.Compare_ex = (L4_MABX_B.Switch_j > L4_MABX_P.Constant_Value_o4); |
| 2830 | |
| 2831 | /* Gain: '<S763>/Gain' incorporates: |
| 2832 | * Constant: '<S422>/Constant2' |
| 2833 | */ |
| 2834 | L4_MABX_B.Gain_e = L4_MABX_P.Gain_Gain_k4 * L4_MABX_P.Constant2_Value_m5; |
| 2835 | |
| 2836 | /* RelationalOperator: '<S763>/LessThanOrEqual' */ |
| 2837 | L4_MABX_B.LessThanOrEqual_o = (L4_MABX_B.Switch_j <= L4_MABX_B.Gain_e); |
| 2838 | |
| 2839 | /* Logic: '<S763>/AND' */ |
| 2840 | L4_MABX_B.AND_i = (L4_MABX_B.Compare_ex && L4_MABX_B.LessThanOrEqual_o); |
| 2841 | |
| 2842 | /* Logic: '<S749>/AND2' */ |
| 2843 | EngagePB = (L4_MABX_B.AND_i && L4_MABX_B.NOT); |
| 2844 | |
| 2845 | /* S-Function (rti_commonblock): '<S744>/S-Function1' */ |
| 2846 | /* This comment workarounds a code generation problem */ |
| 2847 | |
| 2848 | /* DataTypeConversion: '<S422>/StartPBActive1' */ |
| 2849 | L4_MABX_B.StartPBActive1 = L4_MABX_B.SFunction1_p; |
| 2850 | |
| 2851 | /* Logic: '<S422>/Logical Operator3' */ |
| 2852 | BrakeSW = !L4_MABX_B.StartPBActive1; |
| 2853 | |
| 2854 | /* S-Function (rti_commonblock): '<S746>/S-Function1' */ |
| 2855 | /* This comment workarounds a code generation problem */ |
| 2856 | |
| 2857 | /* DataTypeConversion: '<S422>/Data Type Conversion2' */ |
| 2858 | L4_MABX_B.Pedal_1_pwm_freq_raw_value = L4_MABX_B.SFunction1_o1; |
| 2859 | |
| 2860 | /* RelationalOperator: '<S797>/min_relop' incorporates: |
| 2861 | * Constant: '<S769>/PWMAFreqRngMin' |
| 2862 | */ |
| 2863 | L4_MABX_B.min_relop = (L4_MABX_P.PWMAFreqRngMin_Value < |
| 2864 | L4_MABX_B.Pedal_1_pwm_freq_raw_value); |
| 2865 | |
| 2866 | /* RelationalOperator: '<S797>/max_relop' incorporates: |
| 2867 | * Constant: '<S769>/PWMAFreqRngMax' |
| 2868 | */ |
| 2869 | L4_MABX_B.max_relop = (L4_MABX_B.Pedal_1_pwm_freq_raw_value < |
| 2870 | L4_MABX_P.PWMAFreqRngMax_Value); |
| 2871 | |
| 2872 | /* Logic: '<S797>/conjunction' */ |
| 2873 | L4_MABX_B.conjunction = (L4_MABX_B.min_relop && L4_MABX_B.max_relop); |
| 2874 | |
| 2875 | /* UnitDelay: '<S802>/FixPt Unit Delay2' */ |
| 2876 | L4_MABX_B.FixPtUnitDelay2 = L4_MABX_DW.FixPtUnitDelay2_DSTATE; |
| 2877 | |
| 2878 | /* UnitDelay: '<S802>/FixPt Unit Delay1' */ |
| 2879 | L4_MABX_B.Xold = L4_MABX_DW.FixPtUnitDelay1_DSTATE; |
| 2880 | |
| 2881 | /* Switch: '<S802>/Init' incorporates: |
| 2882 | * Constant: '<S769>/PWMAFreqRngFaultLimMin' |
| 2883 | */ |
| 2884 | if (L4_MABX_B.FixPtUnitDelay2 != 0) { |
| 2885 | L4_MABX_B.Init = L4_MABX_P.PWMAFreqRngFaultLimMin_Value; |
| 2886 | } else { |
| 2887 | L4_MABX_B.Init = L4_MABX_B.Xold; |
| 2888 | } |
| 2889 | |
| 2890 | /* End of Switch: '<S802>/Init' */ |
| 2891 | |
| 2892 | /* Sum: '<S798>/FixPt Sum1' incorporates: |
| 2893 | * Constant: '<S798>/FixPt Constant' |
| 2894 | */ |
| 2895 | L4_MABX_B.FixPtSum1 = L4_MABX_B.Init - L4_MABX_P.FixPtConstant_Value_b; |
| 2896 | |
| 2897 | /* Sum: '<S801>/FixPt Sum1' incorporates: |
| 2898 | * Constant: '<S801>/FixPt Constant' |
| 2899 | */ |
| 2900 | L4_MABX_B.FixPtSum1_m = L4_MABX_B.Init + L4_MABX_P.FixPtConstant_Value_o; |
| 2901 | |
| 2902 | /* Outputs for Atomic SubSystem: '<S785>/If_Then_Else3' */ |
| 2903 | L4_MABX_If_Then_Else(L4_MABX_B.conjunction, L4_MABX_B.FixPtSum1, |
| 2904 | L4_MABX_B.FixPtSum1_m, &L4_MABX_B.If_Then_Else3_d); |
| 2905 | |
| 2906 | /* End of Outputs for SubSystem: '<S785>/If_Then_Else3' */ |
| 2907 | |
| 2908 | /* RelationalOperator: '<S799>/Relational Operator1' incorporates: |
| 2909 | * Constant: '<S769>/PWMAFreqRngFaultLimMax' |
| 2910 | */ |
| 2911 | L4_MABX_B.RelationalOperator1 = (L4_MABX_B.If_Then_Else3_d.Switch >= |
| 2912 | L4_MABX_P.PWMAFreqRngFaultLimMax_Value); |
| 2913 | |
| 2914 | /* RelationalOperator: '<S799>/Relational Operator' incorporates: |
| 2915 | * Constant: '<S769>/PWMAFreqRngFaultLimMin' |
| 2916 | */ |
| 2917 | L4_MABX_B.RelationalOperator = (L4_MABX_B.If_Then_Else3_d.Switch <= |
| 2918 | L4_MABX_P.PWMAFreqRngFaultLimMin_Value); |
| 2919 | |
| 2920 | /* Outputs for Atomic SubSystem: '<S799>/If_Then_Else1' */ |
| 2921 | |
| 2922 | /* Constant: '<S769>/PWMAFreqRngFaultLimMin' */ |
| 2923 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator, |
| 2924 | L4_MABX_P.PWMAFreqRngFaultLimMin_Value, |
| 2925 | L4_MABX_B.If_Then_Else3_d.Switch, |
| 2926 | &L4_MABX_B.If_Then_Else1_b); |
| 2927 | |
| 2928 | /* End of Outputs for SubSystem: '<S799>/If_Then_Else1' */ |
| 2929 | |
| 2930 | /* Outputs for Atomic SubSystem: '<S799>/If_Then_Else' */ |
| 2931 | |
| 2932 | /* Constant: '<S769>/PWMAFreqRngFaultLimMax' */ |
| 2933 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1, |
| 2934 | L4_MABX_P.PWMAFreqRngFaultLimMax_Value, |
| 2935 | L4_MABX_B.If_Then_Else1_b.Switch, |
| 2936 | &L4_MABX_B.If_Then_Else_a); |
| 2937 | |
| 2938 | /* End of Outputs for SubSystem: '<S799>/If_Then_Else' */ |
| 2939 | |
| 2940 | /* RelationalOperator: '<S785>/Relational Operator9' incorporates: |
| 2941 | * Constant: '<S769>/PWMAFreqRngFaultLimMin' |
| 2942 | */ |
| 2943 | L4_MABX_B.F_Fault_Soft = (L4_MABX_B.If_Then_Else_a.Switch != |
| 2944 | L4_MABX_P.PWMAFreqRngFaultLimMin_Value); |
| 2945 | |
| 2946 | /* Gain: '<S422>/Gain' */ |
| 2947 | L4_MABX_B.Gain_l = L4_MABX_P.Gain_Gain_pu * L4_MABX_B.SFunction1_o2; |
| 2948 | |
| 2949 | /* DataTypeConversion: '<S422>/Data Type Conversion9' */ |
| 2950 | L4_MABX_B.Pedal_1_pwm_dc_raw_value = L4_MABX_B.Gain_l; |
| 2951 | |
| 2952 | /* RelationalOperator: '<S789>/min_relop' incorporates: |
| 2953 | * Constant: '<S769>/PWMADCRngMin' |
| 2954 | */ |
| 2955 | L4_MABX_B.min_relop_e = (L4_MABX_P.PWMADCRngMin_Value < |
| 2956 | L4_MABX_B.Pedal_1_pwm_dc_raw_value); |
| 2957 | |
| 2958 | /* RelationalOperator: '<S789>/max_relop' incorporates: |
| 2959 | * Constant: '<S769>/PWMADCRngMax' |
| 2960 | */ |
| 2961 | L4_MABX_B.max_relop_c = (L4_MABX_B.Pedal_1_pwm_dc_raw_value < |
| 2962 | L4_MABX_P.PWMADCRngMax_Value); |
| 2963 | |
| 2964 | /* Logic: '<S789>/conjunction' */ |
| 2965 | L4_MABX_B.conjunction_p = (L4_MABX_B.min_relop_e && L4_MABX_B.max_relop_c); |
| 2966 | |
| 2967 | /* UnitDelay: '<S794>/FixPt Unit Delay2' */ |
| 2968 | L4_MABX_B.FixPtUnitDelay2_n = L4_MABX_DW.FixPtUnitDelay2_DSTATE_d; |
| 2969 | |
| 2970 | /* UnitDelay: '<S794>/FixPt Unit Delay1' */ |
| 2971 | L4_MABX_B.Xold_j = L4_MABX_DW.FixPtUnitDelay1_DSTATE_d; |
| 2972 | |
| 2973 | /* Switch: '<S794>/Init' incorporates: |
| 2974 | * Constant: '<S769>/PWMADCRngFaultLimMin' |
| 2975 | */ |
| 2976 | if (L4_MABX_B.FixPtUnitDelay2_n != 0) { |
| 2977 | L4_MABX_B.Init_f = L4_MABX_P.PWMADCRngFaultLimMin_Value; |
| 2978 | } else { |
| 2979 | L4_MABX_B.Init_f = L4_MABX_B.Xold_j; |
| 2980 | } |
| 2981 | |
| 2982 | /* End of Switch: '<S794>/Init' */ |
| 2983 | |
| 2984 | /* Sum: '<S790>/FixPt Sum1' incorporates: |
| 2985 | * Constant: '<S790>/FixPt Constant' |
| 2986 | */ |
| 2987 | L4_MABX_B.FixPtSum1_n = L4_MABX_B.Init_f - L4_MABX_P.FixPtConstant_Value_j; |
| 2988 | |
| 2989 | /* Sum: '<S793>/FixPt Sum1' incorporates: |
| 2990 | * Constant: '<S793>/FixPt Constant' |
| 2991 | */ |
| 2992 | L4_MABX_B.FixPtSum1_o = L4_MABX_B.Init_f + L4_MABX_P.FixPtConstant_Value_oo; |
| 2993 | |
| 2994 | /* Outputs for Atomic SubSystem: '<S784>/If_Then_Else3' */ |
| 2995 | L4_MABX_If_Then_Else(L4_MABX_B.conjunction_p, L4_MABX_B.FixPtSum1_n, |
| 2996 | L4_MABX_B.FixPtSum1_o, &L4_MABX_B.If_Then_Else3); |
| 2997 | |
| 2998 | /* End of Outputs for SubSystem: '<S784>/If_Then_Else3' */ |
| 2999 | |
| 3000 | /* RelationalOperator: '<S791>/Relational Operator1' incorporates: |
| 3001 | * Constant: '<S769>/PWMADCRngFaultLimMax' |
| 3002 | */ |
| 3003 | L4_MABX_B.RelationalOperator1_l = (L4_MABX_B.If_Then_Else3.Switch >= |
| 3004 | L4_MABX_P.PWMADCRngFaultLimMax_Value); |
| 3005 | |
| 3006 | /* RelationalOperator: '<S791>/Relational Operator' incorporates: |
| 3007 | * Constant: '<S769>/PWMADCRngFaultLimMin' |
| 3008 | */ |
| 3009 | L4_MABX_B.RelationalOperator_m = (L4_MABX_B.If_Then_Else3.Switch <= |
| 3010 | L4_MABX_P.PWMADCRngFaultLimMin_Value); |
| 3011 | |
| 3012 | /* Outputs for Atomic SubSystem: '<S791>/If_Then_Else1' */ |
| 3013 | |
| 3014 | /* Constant: '<S769>/PWMADCRngFaultLimMin' */ |
| 3015 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_m, |
| 3016 | L4_MABX_P.PWMADCRngFaultLimMin_Value, |
| 3017 | L4_MABX_B.If_Then_Else3.Switch, |
| 3018 | &L4_MABX_B.If_Then_Else1_p); |
| 3019 | |
| 3020 | /* End of Outputs for SubSystem: '<S791>/If_Then_Else1' */ |
| 3021 | |
| 3022 | /* Outputs for Atomic SubSystem: '<S791>/If_Then_Else' */ |
| 3023 | |
| 3024 | /* Constant: '<S769>/PWMADCRngFaultLimMax' */ |
| 3025 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_l, |
| 3026 | L4_MABX_P.PWMADCRngFaultLimMax_Value, |
| 3027 | L4_MABX_B.If_Then_Else1_p.Switch, |
| 3028 | &L4_MABX_B.If_Then_Else_h); |
| 3029 | |
| 3030 | /* End of Outputs for SubSystem: '<S791>/If_Then_Else' */ |
| 3031 | |
| 3032 | /* RelationalOperator: '<S784>/Relational Operator9' incorporates: |
| 3033 | * Constant: '<S769>/PWMADCRngFaultLimMin' |
| 3034 | */ |
| 3035 | L4_MABX_B.F_Fault_Soft_c = (L4_MABX_B.If_Then_Else_h.Switch != |
| 3036 | L4_MABX_P.PWMADCRngFaultLimMin_Value); |
| 3037 | |
| 3038 | /* Logic: '<S769>/Logical Operator2' */ |
| 3039 | L4_MABX_B.LogicalOperator2 = (L4_MABX_B.F_Fault_Soft || |
| 3040 | L4_MABX_B.F_Fault_Soft_c); |
| 3041 | |
| 3042 | /* RelationalOperator: '<S785>/Relational Operator8' incorporates: |
| 3043 | * Constant: '<S769>/PWMAFreqRngFaultLimMax' |
| 3044 | */ |
| 3045 | L4_MABX_B.F_Fault_Hard = (L4_MABX_P.PWMAFreqRngFaultLimMax_Value <= |
| 3046 | L4_MABX_B.If_Then_Else_a.Switch); |
| 3047 | |
| 3048 | /* RelationalOperator: '<S784>/Relational Operator8' incorporates: |
| 3049 | * Constant: '<S769>/PWMADCRngFaultLimMax' |
| 3050 | */ |
| 3051 | L4_MABX_B.F_Fault_Hard_c = (L4_MABX_P.PWMADCRngFaultLimMax_Value <= |
| 3052 | L4_MABX_B.If_Then_Else_h.Switch); |
| 3053 | |
| 3054 | /* Logic: '<S769>/Logical Operator1' */ |
| 3055 | L4_MABX_B.LogicalOperator1 = (L4_MABX_B.F_Fault_Hard || |
| 3056 | L4_MABX_B.F_Fault_Hard_c); |
| 3057 | |
| 3058 | /* Chart: '<S769>/Health State Machine PWM Sensor 1' */ |
| 3059 | /* Gateway: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 1 */ |
| 3060 | /* During: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 1 */ |
| 3061 | if (L4_MABX_DW.is_active_c9_SUB_ECU_L4_MABX_HW == 0U) { |
| 3062 | /* Entry: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 1 */ |
| 3063 | L4_MABX_DW.is_active_c9_SUB_ECU_L4_MABX_HW = 1U; |
| 3064 | |
| 3065 | /* Entry Internal: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 1 */ |
| 3066 | /* Transition: '<S782>:2' */ |
| 3067 | L4_MABX_DW.is_c9_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_NO_FAILURE; |
| 3068 | |
| 3069 | /* Entry 'NO_FAILURE': '<S782>:1' */ |
| 3070 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE; |
| 3071 | } else if (L4_MABX_DW.is_c9_SUB_ECU_L4_MABX_HW_Interf == |
| 3072 | L4_MABX_IN_FAILURE_DETECTED) { |
| 3073 | /* During 'FAILURE_DETECTED': '<S782>:6' */ |
| 3074 | if (L4_MABX_DW.is_FAILURE_DETECTED_b == L4_MABX_IN_ERROR) { |
| 3075 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_ACTIVE; |
| 3076 | |
| 3077 | /* During 'ERROR': '<S782>:8' */ |
| 3078 | if (!L4_MABX_B.LogicalOperator1) { |
| 3079 | /* Transition: '<S782>:17' */ |
| 3080 | L4_MABX_DW.is_FAILURE_DETECTED_b = L4_MABX_IN_PENDING; |
| 3081 | |
| 3082 | /* Entry 'PENDING': '<S782>:7' */ |
| 3083 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING; |
| 3084 | } |
| 3085 | } else { |
| 3086 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING; |
| 3087 | |
| 3088 | /* During 'PENDING': '<S782>:7' */ |
| 3089 | zcEvent = ((!L4_MABX_B.LogicalOperator2) && (!L4_MABX_B.LogicalOperator1)); |
| 3090 | if (zcEvent) { |
| 3091 | /* Transition: '<S782>:9' */ |
| 3092 | L4_MABX_DW.is_FAILURE_DETECTED_b = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 3093 | L4_MABX_DW.is_c9_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_NO_FAILURE; |
| 3094 | |
| 3095 | /* Entry 'NO_FAILURE': '<S782>:1' */ |
| 3096 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE; |
| 3097 | } else { |
| 3098 | if (L4_MABX_B.LogicalOperator1) { |
| 3099 | /* Transition: '<S782>:12' */ |
| 3100 | L4_MABX_DW.is_FAILURE_DETECTED_b = L4_MABX_IN_ERROR; |
| 3101 | |
| 3102 | /* Entry 'ERROR': '<S782>:8' */ |
| 3103 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_ACTIVE; |
| 3104 | } |
| 3105 | } |
| 3106 | } |
| 3107 | } else { |
| 3108 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE; |
| 3109 | |
| 3110 | /* During 'NO_FAILURE': '<S782>:1' */ |
| 3111 | zcEvent = (L4_MABX_B.LogicalOperator2 || L4_MABX_B.LogicalOperator1); |
| 3112 | if (zcEvent) { |
| 3113 | /* Transition: '<S782>:10' */ |
| 3114 | L4_MABX_DW.is_c9_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_FAILURE_DETECTED; |
| 3115 | |
| 3116 | /* Entry 'FAILURE_DETECTED': '<S782>:6' */ |
| 3117 | /* Entry Internal 'FAILURE_DETECTED': '<S782>:6' */ |
| 3118 | /* Transition: '<S782>:11' */ |
| 3119 | L4_MABX_DW.is_FAILURE_DETECTED_b = L4_MABX_IN_PENDING; |
| 3120 | |
| 3121 | /* Entry 'PENDING': '<S782>:7' */ |
| 3122 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING; |
| 3123 | } |
| 3124 | } |
| 3125 | |
| 3126 | /* End of Chart: '<S769>/Health State Machine PWM Sensor 1' */ |
| 3127 | |
| 3128 | /* RelationalOperator: '<S780>/Compare' incorporates: |
| 3129 | * Constant: '<S780>/Constant' |
| 3130 | */ |
| 3131 | L4_MABX_B.Compare_n = (L4_MABX_B.Pedal_1_pwm_health_state == |
| 3132 | L4_MABX_P.CompareToConstant_const_g2); |
| 3133 | |
| 3134 | /* S-Function (rti_commonblock): '<S747>/S-Function1' */ |
| 3135 | /* This comment workarounds a code generation problem */ |
| 3136 | |
| 3137 | /* DataTypeConversion: '<S422>/Data Type Conversion3' */ |
| 3138 | L4_MABX_B.Pedal_2_pwm_freq_raw_value = L4_MABX_B.SFunction1_o1_k; |
| 3139 | |
| 3140 | /* RelationalOperator: '<S813>/min_relop' incorporates: |
| 3141 | * Constant: '<S769>/PWMBFreqRngMin1' |
| 3142 | */ |
| 3143 | L4_MABX_B.min_relop_a = (L4_MABX_P.PWMBFreqRngMin1_Value < |
| 3144 | L4_MABX_B.Pedal_2_pwm_freq_raw_value); |
| 3145 | |
| 3146 | /* RelationalOperator: '<S813>/max_relop' incorporates: |
| 3147 | * Constant: '<S769>/PWMBFreqRngMax1' |
| 3148 | */ |
| 3149 | L4_MABX_B.max_relop_j = (L4_MABX_B.Pedal_2_pwm_freq_raw_value < |
| 3150 | L4_MABX_P.PWMBFreqRngMax1_Value); |
| 3151 | |
| 3152 | /* Logic: '<S813>/conjunction' */ |
| 3153 | L4_MABX_B.conjunction_f = (L4_MABX_B.min_relop_a && L4_MABX_B.max_relop_j); |
| 3154 | |
| 3155 | /* UnitDelay: '<S818>/FixPt Unit Delay2' */ |
| 3156 | L4_MABX_B.FixPtUnitDelay2_c = L4_MABX_DW.FixPtUnitDelay2_DSTATE_a; |
| 3157 | |
| 3158 | /* UnitDelay: '<S818>/FixPt Unit Delay1' */ |
| 3159 | L4_MABX_B.Xold_e = L4_MABX_DW.FixPtUnitDelay1_DSTATE_g; |
| 3160 | |
| 3161 | /* Switch: '<S818>/Init' incorporates: |
| 3162 | * Constant: '<S769>/PWMBFreqRngFaultLimMin1' |
| 3163 | */ |
| 3164 | if (L4_MABX_B.FixPtUnitDelay2_c != 0) { |
| 3165 | L4_MABX_B.Init_i = L4_MABX_P.PWMBFreqRngFaultLimMin1_Value; |
| 3166 | } else { |
| 3167 | L4_MABX_B.Init_i = L4_MABX_B.Xold_e; |
| 3168 | } |
| 3169 | |
| 3170 | /* End of Switch: '<S818>/Init' */ |
| 3171 | |
| 3172 | /* Sum: '<S814>/FixPt Sum1' incorporates: |
| 3173 | * Constant: '<S814>/FixPt Constant' |
| 3174 | */ |
| 3175 | L4_MABX_B.FixPtSum1_a = L4_MABX_B.Init_i - L4_MABX_P.FixPtConstant_Value_a; |
| 3176 | |
| 3177 | /* Sum: '<S817>/FixPt Sum1' incorporates: |
| 3178 | * Constant: '<S817>/FixPt Constant' |
| 3179 | */ |
| 3180 | L4_MABX_B.FixPtSum1_me = L4_MABX_B.Init_i + L4_MABX_P.FixPtConstant_Value_n; |
| 3181 | |
| 3182 | /* Outputs for Atomic SubSystem: '<S787>/If_Then_Else3' */ |
| 3183 | L4_MABX_If_Then_Else(L4_MABX_B.conjunction_f, L4_MABX_B.FixPtSum1_a, |
| 3184 | L4_MABX_B.FixPtSum1_me, &L4_MABX_B.If_Then_Else3_f); |
| 3185 | |
| 3186 | /* End of Outputs for SubSystem: '<S787>/If_Then_Else3' */ |
| 3187 | |
| 3188 | /* RelationalOperator: '<S815>/Relational Operator1' incorporates: |
| 3189 | * Constant: '<S769>/PWMBFreqRngFaultLimMax1' |
| 3190 | */ |
| 3191 | L4_MABX_B.RelationalOperator1_c = (L4_MABX_B.If_Then_Else3_f.Switch >= |
| 3192 | L4_MABX_P.PWMBFreqRngFaultLimMax1_Value); |
| 3193 | |
| 3194 | /* RelationalOperator: '<S815>/Relational Operator' incorporates: |
| 3195 | * Constant: '<S769>/PWMBFreqRngFaultLimMin1' |
| 3196 | */ |
| 3197 | L4_MABX_B.RelationalOperator_c = (L4_MABX_B.If_Then_Else3_f.Switch <= |
| 3198 | L4_MABX_P.PWMBFreqRngFaultLimMin1_Value); |
| 3199 | |
| 3200 | /* Outputs for Atomic SubSystem: '<S815>/If_Then_Else1' */ |
| 3201 | |
| 3202 | /* Constant: '<S769>/PWMBFreqRngFaultLimMin1' */ |
| 3203 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_c, |
| 3204 | L4_MABX_P.PWMBFreqRngFaultLimMin1_Value, |
| 3205 | L4_MABX_B.If_Then_Else3_f.Switch, |
| 3206 | &L4_MABX_B.If_Then_Else1_br); |
| 3207 | |
| 3208 | /* End of Outputs for SubSystem: '<S815>/If_Then_Else1' */ |
| 3209 | |
| 3210 | /* Outputs for Atomic SubSystem: '<S815>/If_Then_Else' */ |
| 3211 | |
| 3212 | /* Constant: '<S769>/PWMBFreqRngFaultLimMax1' */ |
| 3213 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_c, |
| 3214 | L4_MABX_P.PWMBFreqRngFaultLimMax1_Value, |
| 3215 | L4_MABX_B.If_Then_Else1_br.Switch, |
| 3216 | &L4_MABX_B.If_Then_Else_p); |
| 3217 | |
| 3218 | /* End of Outputs for SubSystem: '<S815>/If_Then_Else' */ |
| 3219 | |
| 3220 | /* RelationalOperator: '<S787>/Relational Operator9' incorporates: |
| 3221 | * Constant: '<S769>/PWMBFreqRngFaultLimMin1' |
| 3222 | */ |
| 3223 | L4_MABX_B.F_Fault_Soft_i = (L4_MABX_B.If_Then_Else_p.Switch != |
| 3224 | L4_MABX_P.PWMBFreqRngFaultLimMin1_Value); |
| 3225 | |
| 3226 | /* Gain: '<S422>/Gain1' */ |
| 3227 | L4_MABX_B.Gain1 = L4_MABX_P.Gain1_Gain_ps * L4_MABX_B.SFunction1_o2_m; |
| 3228 | |
| 3229 | /* DataTypeConversion: '<S422>/Data Type Conversion1' */ |
| 3230 | L4_MABX_B.Pedal_2_pwm_dc_raw_value = L4_MABX_B.Gain1; |
| 3231 | |
| 3232 | /* RelationalOperator: '<S805>/min_relop' incorporates: |
| 3233 | * Constant: '<S769>/PWMBDCRngMin1' |
| 3234 | */ |
| 3235 | L4_MABX_B.min_relop_o = (L4_MABX_P.PWMBDCRngMin1_Value < |
| 3236 | L4_MABX_B.Pedal_2_pwm_dc_raw_value); |
| 3237 | |
| 3238 | /* RelationalOperator: '<S805>/max_relop' incorporates: |
| 3239 | * Constant: '<S769>/PWMBDCRngMax1' |
| 3240 | */ |
| 3241 | L4_MABX_B.max_relop_m = (L4_MABX_B.Pedal_2_pwm_dc_raw_value < |
| 3242 | L4_MABX_P.PWMBDCRngMax1_Value); |
| 3243 | |
| 3244 | /* Logic: '<S805>/conjunction' */ |
| 3245 | L4_MABX_B.conjunction_d = (L4_MABX_B.min_relop_o && L4_MABX_B.max_relop_m); |
| 3246 | |
| 3247 | /* UnitDelay: '<S810>/FixPt Unit Delay2' */ |
| 3248 | L4_MABX_B.FixPtUnitDelay2_i = L4_MABX_DW.FixPtUnitDelay2_DSTATE_i; |
| 3249 | |
| 3250 | /* UnitDelay: '<S810>/FixPt Unit Delay1' */ |
| 3251 | L4_MABX_B.Xold_p = L4_MABX_DW.FixPtUnitDelay1_DSTATE_e; |
| 3252 | |
| 3253 | /* Switch: '<S810>/Init' incorporates: |
| 3254 | * Constant: '<S769>/PWMBDCRngFaultLimMin1' |
| 3255 | */ |
| 3256 | if (L4_MABX_B.FixPtUnitDelay2_i != 0) { |
| 3257 | L4_MABX_B.Init_j = L4_MABX_P.PWMBDCRngFaultLimMin1_Value; |
| 3258 | } else { |
| 3259 | L4_MABX_B.Init_j = L4_MABX_B.Xold_p; |
| 3260 | } |
| 3261 | |
| 3262 | /* End of Switch: '<S810>/Init' */ |
| 3263 | |
| 3264 | /* Sum: '<S806>/FixPt Sum1' incorporates: |
| 3265 | * Constant: '<S806>/FixPt Constant' |
| 3266 | */ |
| 3267 | L4_MABX_B.FixPtSum1_p = L4_MABX_B.Init_j - L4_MABX_P.FixPtConstant_Value_k; |
| 3268 | |
| 3269 | /* Sum: '<S809>/FixPt Sum1' incorporates: |
| 3270 | * Constant: '<S809>/FixPt Constant' |
| 3271 | */ |
| 3272 | L4_MABX_B.FixPtSum1_h = L4_MABX_B.Init_j + L4_MABX_P.FixPtConstant_Value_oj; |
| 3273 | |
| 3274 | /* Outputs for Atomic SubSystem: '<S786>/If_Then_Else3' */ |
| 3275 | L4_MABX_If_Then_Else(L4_MABX_B.conjunction_d, L4_MABX_B.FixPtSum1_p, |
| 3276 | L4_MABX_B.FixPtSum1_h, &L4_MABX_B.If_Then_Else3_de); |
| 3277 | |
| 3278 | /* End of Outputs for SubSystem: '<S786>/If_Then_Else3' */ |
| 3279 | |
| 3280 | /* RelationalOperator: '<S807>/Relational Operator1' incorporates: |
| 3281 | * Constant: '<S769>/PWMBDCRngFaultLimMax1' |
| 3282 | */ |
| 3283 | L4_MABX_B.RelationalOperator1_p = (L4_MABX_B.If_Then_Else3_de.Switch >= |
| 3284 | L4_MABX_P.PWMBDCRngFaultLimMax1_Value); |
| 3285 | |
| 3286 | /* RelationalOperator: '<S807>/Relational Operator' incorporates: |
| 3287 | * Constant: '<S769>/PWMBDCRngFaultLimMin1' |
| 3288 | */ |
| 3289 | L4_MABX_B.RelationalOperator_l = (L4_MABX_B.If_Then_Else3_de.Switch <= |
| 3290 | L4_MABX_P.PWMBDCRngFaultLimMin1_Value); |
| 3291 | |
| 3292 | /* Outputs for Atomic SubSystem: '<S807>/If_Then_Else1' */ |
| 3293 | |
| 3294 | /* Constant: '<S769>/PWMBDCRngFaultLimMin1' */ |
| 3295 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_l, |
| 3296 | L4_MABX_P.PWMBDCRngFaultLimMin1_Value, |
| 3297 | L4_MABX_B.If_Then_Else3_de.Switch, |
| 3298 | &L4_MABX_B.If_Then_Else1_g); |
| 3299 | |
| 3300 | /* End of Outputs for SubSystem: '<S807>/If_Then_Else1' */ |
| 3301 | |
| 3302 | /* Outputs for Atomic SubSystem: '<S807>/If_Then_Else' */ |
| 3303 | |
| 3304 | /* Constant: '<S769>/PWMBDCRngFaultLimMax1' */ |
| 3305 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_p, |
| 3306 | L4_MABX_P.PWMBDCRngFaultLimMax1_Value, |
| 3307 | L4_MABX_B.If_Then_Else1_g.Switch, |
| 3308 | &L4_MABX_B.If_Then_Else_k); |
| 3309 | |
| 3310 | /* End of Outputs for SubSystem: '<S807>/If_Then_Else' */ |
| 3311 | |
| 3312 | /* RelationalOperator: '<S786>/Relational Operator9' incorporates: |
| 3313 | * Constant: '<S769>/PWMBDCRngFaultLimMin1' |
| 3314 | */ |
| 3315 | L4_MABX_B.F_Fault_Soft_e = (L4_MABX_B.If_Then_Else_k.Switch != |
| 3316 | L4_MABX_P.PWMBDCRngFaultLimMin1_Value); |
| 3317 | |
| 3318 | /* Logic: '<S769>/Logical Operator4' */ |
| 3319 | L4_MABX_B.LogicalOperator4 = (L4_MABX_B.F_Fault_Soft_i || |
| 3320 | L4_MABX_B.F_Fault_Soft_e); |
| 3321 | |
| 3322 | /* RelationalOperator: '<S787>/Relational Operator8' incorporates: |
| 3323 | * Constant: '<S769>/PWMBFreqRngFaultLimMax1' |
| 3324 | */ |
| 3325 | L4_MABX_B.F_Fault_Hard_h = (L4_MABX_P.PWMBFreqRngFaultLimMax1_Value <= |
| 3326 | L4_MABX_B.If_Then_Else_p.Switch); |
| 3327 | |
| 3328 | /* RelationalOperator: '<S786>/Relational Operator8' incorporates: |
| 3329 | * Constant: '<S769>/PWMBDCRngFaultLimMax1' |
| 3330 | */ |
| 3331 | L4_MABX_B.F_Fault_Hard_p = (L4_MABX_P.PWMBDCRngFaultLimMax1_Value <= |
| 3332 | L4_MABX_B.If_Then_Else_k.Switch); |
| 3333 | |
| 3334 | /* Logic: '<S769>/Logical Operator3' */ |
| 3335 | L4_MABX_B.LogicalOperator3 = (L4_MABX_B.F_Fault_Hard_h || |
| 3336 | L4_MABX_B.F_Fault_Hard_p); |
| 3337 | |
| 3338 | /* Chart: '<S769>/Health State Machine PWM Sensor 2' */ |
| 3339 | /* Gateway: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 2 */ |
| 3340 | /* During: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 2 */ |
| 3341 | if (L4_MABX_DW.is_active_c10_SUB_ECU_L4_MABX_H == 0U) { |
| 3342 | /* Entry: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 2 */ |
| 3343 | L4_MABX_DW.is_active_c10_SUB_ECU_L4_MABX_H = 1U; |
| 3344 | |
| 3345 | /* Entry Internal: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 2 */ |
| 3346 | /* Transition: '<S783>:2' */ |
| 3347 | L4_MABX_DW.is_c10_SUB_ECU_L4_MABX_HW_Inter = L4_MABX_IN_NO_FAILURE; |
| 3348 | |
| 3349 | /* Entry 'NO_FAILURE': '<S783>:1' */ |
| 3350 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE; |
| 3351 | } else if (L4_MABX_DW.is_c10_SUB_ECU_L4_MABX_HW_Inter == |
| 3352 | L4_MABX_IN_FAILURE_DETECTED) { |
| 3353 | /* During 'FAILURE_DETECTED': '<S783>:6' */ |
| 3354 | if (L4_MABX_DW.is_FAILURE_DETECTED == L4_MABX_IN_ERROR) { |
| 3355 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_ACTIVE; |
| 3356 | |
| 3357 | /* During 'ERROR': '<S783>:8' */ |
| 3358 | if (!L4_MABX_B.LogicalOperator3) { |
| 3359 | /* Transition: '<S783>:20' */ |
| 3360 | L4_MABX_DW.is_FAILURE_DETECTED = L4_MABX_IN_PENDING; |
| 3361 | |
| 3362 | /* Entry 'PENDING': '<S783>:7' */ |
| 3363 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING; |
| 3364 | } |
| 3365 | } else { |
| 3366 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING; |
| 3367 | |
| 3368 | /* During 'PENDING': '<S783>:7' */ |
| 3369 | zcEvent = ((!L4_MABX_B.LogicalOperator4) && (!L4_MABX_B.LogicalOperator3)); |
| 3370 | if (zcEvent) { |
| 3371 | /* Transition: '<S783>:9' */ |
| 3372 | L4_MABX_DW.is_FAILURE_DETECTED = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 3373 | L4_MABX_DW.is_c10_SUB_ECU_L4_MABX_HW_Inter = L4_MABX_IN_NO_FAILURE; |
| 3374 | |
| 3375 | /* Entry 'NO_FAILURE': '<S783>:1' */ |
| 3376 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE; |
| 3377 | } else { |
| 3378 | if (L4_MABX_B.LogicalOperator3) { |
| 3379 | /* Transition: '<S783>:12' */ |
| 3380 | L4_MABX_DW.is_FAILURE_DETECTED = L4_MABX_IN_ERROR; |
| 3381 | |
| 3382 | /* Entry 'ERROR': '<S783>:8' */ |
| 3383 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_ACTIVE; |
| 3384 | } |
| 3385 | } |
| 3386 | } |
| 3387 | } else { |
| 3388 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE; |
| 3389 | |
| 3390 | /* During 'NO_FAILURE': '<S783>:1' */ |
| 3391 | zcEvent = (L4_MABX_B.LogicalOperator4 || L4_MABX_B.LogicalOperator3); |
| 3392 | if (zcEvent) { |
| 3393 | /* Transition: '<S783>:10' */ |
| 3394 | L4_MABX_DW.is_c10_SUB_ECU_L4_MABX_HW_Inter = L4_MABX_IN_FAILURE_DETECTED; |
| 3395 | |
| 3396 | /* Entry 'FAILURE_DETECTED': '<S783>:6' */ |
| 3397 | /* Entry Internal 'FAILURE_DETECTED': '<S783>:6' */ |
| 3398 | /* Transition: '<S783>:11' */ |
| 3399 | L4_MABX_DW.is_FAILURE_DETECTED = L4_MABX_IN_PENDING; |
| 3400 | |
| 3401 | /* Entry 'PENDING': '<S783>:7' */ |
| 3402 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING; |
| 3403 | } |
| 3404 | } |
| 3405 | |
| 3406 | /* End of Chart: '<S769>/Health State Machine PWM Sensor 2' */ |
| 3407 | |
| 3408 | /* RelationalOperator: '<S781>/Compare' incorporates: |
| 3409 | * Constant: '<S781>/Constant' |
| 3410 | */ |
| 3411 | L4_MABX_B.Compare_a = (L4_MABX_B.Pedal_2_pwm_health_state == |
| 3412 | L4_MABX_P.CompareToConstant2_const_d); |
| 3413 | |
| 3414 | /* Logic: '<S769>/Logical Operator5' */ |
| 3415 | L4_MABX_B.F_Pedal_pwm_sens_total_failure = (L4_MABX_B.Compare_n && |
| 3416 | L4_MABX_B.Compare_a); |
| 3417 | |
| 3418 | /* UnitDelay: '<S772>/Unit_Delay' */ |
| 3419 | L4_MABX_B.Unit_Delay_bl = L4_MABX_DW.Unit_Delay_DSTATE_pw; |
| 3420 | |
| 3421 | /* UnitDelay: '<S839>/Unit_Delay1' */ |
| 3422 | L4_MABX_B.Unit_Delay1 = L4_MABX_DW.Unit_Delay1_DSTATE; |
| 3423 | |
| 3424 | /* Logic: '<S839>/Logical Operator' */ |
| 3425 | L4_MABX_B.LogicalOperator_i = (L4_MABX_B.Unit_Delay_bl || |
| 3426 | L4_MABX_B.Unit_Delay1); |
| 3427 | |
| 3428 | /* MinMax: '<S839>/MinMax1' incorporates: |
| 3429 | * Constant: '<S772>/PEDAL_PWM_SENSOR_DATA_APV.T1_CONST' |
| 3430 | * Constant: '<S772>/dT' |
| 3431 | */ |
| 3432 | DeltaTime = L4_MABX_P.dT_Value; |
| 3433 | PositionFinalLimited = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVT1_CON; |
| 3434 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 3435 | PositionFinalLimited = DeltaTime; |
| 3436 | } |
| 3437 | |
| 3438 | L4_MABX_B.MinMax1 = PositionFinalLimited; |
| 3439 | |
| 3440 | /* End of MinMax: '<S839>/MinMax1' */ |
| 3441 | |
| 3442 | /* Saturate: '<S839>/Saturation' */ |
| 3443 | DeltaTime = L4_MABX_B.MinMax1; |
| 3444 | Time56 = L4_MABX_P.Saturation_LowerSat_f; |
| 3445 | AccelerationAverage = L4_MABX_P.Saturation_UpperSat_ld; |
| 3446 | if (DeltaTime > AccelerationAverage) { |
| 3447 | L4_MABX_B.Saturation = AccelerationAverage; |
| 3448 | } else if (DeltaTime < Time56) { |
| 3449 | L4_MABX_B.Saturation = Time56; |
| 3450 | } else { |
| 3451 | L4_MABX_B.Saturation = DeltaTime; |
| 3452 | } |
| 3453 | |
| 3454 | /* End of Saturate: '<S839>/Saturation' */ |
| 3455 | |
| 3456 | /* Product: '<S839>/Divide' incorporates: |
| 3457 | * Constant: '<S772>/dT' |
| 3458 | */ |
| 3459 | L4_MABX_B.Divide = L4_MABX_P.dT_Value / L4_MABX_B.Saturation; |
| 3460 | |
| 3461 | /* Product: '<S839>/Product2' */ |
| 3462 | L4_MABX_B.Product2 = L4_MABX_B.Pedal_1_pwm_dc_raw_value * L4_MABX_B.Divide; |
| 3463 | |
| 3464 | /* Sum: '<S839>/Subtract1' incorporates: |
| 3465 | * Constant: '<S839>/Constant1' |
| 3466 | */ |
| 3467 | L4_MABX_B.Subtract1 = L4_MABX_P.Constant1_Value_cw - L4_MABX_B.Divide; |
| 3468 | |
| 3469 | /* UnitDelay: '<S839>/Unit_Delay2' */ |
| 3470 | L4_MABX_B.Unit_Delay2 = L4_MABX_DW.Unit_Delay2_DSTATE; |
| 3471 | |
| 3472 | /* Product: '<S839>/Product1' */ |
| 3473 | L4_MABX_B.Product1 = L4_MABX_B.Subtract1 * L4_MABX_B.Unit_Delay2; |
| 3474 | |
| 3475 | /* Sum: '<S839>/Add1' */ |
| 3476 | L4_MABX_B.Add1 = L4_MABX_B.Product2 + L4_MABX_B.Product1; |
| 3477 | |
| 3478 | /* Outputs for Atomic SubSystem: '<S839>/If_Then_Else' */ |
| 3479 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_i, |
| 3480 | L4_MABX_B.Pedal_1_pwm_dc_raw_value, L4_MABX_B.Add1, |
| 3481 | &L4_MABX_B.If_Then_Else_i); |
| 3482 | |
| 3483 | /* End of Outputs for SubSystem: '<S839>/If_Then_Else' */ |
| 3484 | |
| 3485 | /* Lookup_n-D: '<S772>/PEDAL_PWM_ANGLE_SENS_1_MPV' */ |
| 3486 | L4_MABX_B.Pedal_1_pwm_undefault = look1_binlcapw |
| 3487 | (L4_MABX_B.If_Then_Else_i.Switch, L4_MABX_P.PEDAL_PWM_ANGLE_SENS_1_MPV_bp01, |
| 3488 | L4_MABX_P.PEDAL_PWM_ANGLE_SENS_1_MPV_tabl, 7U); |
| 3489 | |
| 3490 | /* UnitDelay: '<S772>/Unit_Delay1' */ |
| 3491 | L4_MABX_B.Unit_Delay1_a = L4_MABX_DW.Unit_Delay1_DSTATE_m; |
| 3492 | |
| 3493 | /* UnitDelay: '<S840>/Unit_Delay1' */ |
| 3494 | L4_MABX_B.Unit_Delay1_d = L4_MABX_DW.Unit_Delay1_DSTATE_p; |
| 3495 | |
| 3496 | /* Logic: '<S840>/Logical Operator' */ |
| 3497 | L4_MABX_B.LogicalOperator_p = (L4_MABX_B.Unit_Delay1_a || |
| 3498 | L4_MABX_B.Unit_Delay1_d); |
| 3499 | |
| 3500 | /* MinMax: '<S840>/MinMax1' incorporates: |
| 3501 | * Constant: '<S772>/PEDAL_PWM_SENSOR_DATA_APV.T2_CONST' |
| 3502 | * Constant: '<S772>/dT1' |
| 3503 | */ |
| 3504 | DeltaTime = L4_MABX_P.dT1_Value; |
| 3505 | PositionFinalLimited = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVT2_CON; |
| 3506 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 3507 | PositionFinalLimited = DeltaTime; |
| 3508 | } |
| 3509 | |
| 3510 | L4_MABX_B.MinMax1_a = PositionFinalLimited; |
| 3511 | |
| 3512 | /* End of MinMax: '<S840>/MinMax1' */ |
| 3513 | |
| 3514 | /* Saturate: '<S840>/Saturation' */ |
| 3515 | DeltaTime = L4_MABX_B.MinMax1_a; |
| 3516 | Time56 = L4_MABX_P.Saturation_LowerSat_bz; |
| 3517 | AccelerationAverage = L4_MABX_P.Saturation_UpperSat_b; |
| 3518 | if (DeltaTime > AccelerationAverage) { |
| 3519 | L4_MABX_B.Saturation_l = AccelerationAverage; |
| 3520 | } else if (DeltaTime < Time56) { |
| 3521 | L4_MABX_B.Saturation_l = Time56; |
| 3522 | } else { |
| 3523 | L4_MABX_B.Saturation_l = DeltaTime; |
| 3524 | } |
| 3525 | |
| 3526 | /* End of Saturate: '<S840>/Saturation' */ |
| 3527 | |
| 3528 | /* Product: '<S840>/Divide' incorporates: |
| 3529 | * Constant: '<S772>/dT1' |
| 3530 | */ |
| 3531 | L4_MABX_B.Divide_c = L4_MABX_P.dT1_Value / L4_MABX_B.Saturation_l; |
| 3532 | |
| 3533 | /* Product: '<S840>/Product2' */ |
| 3534 | L4_MABX_B.Product2_e = L4_MABX_B.Pedal_2_pwm_freq_raw_value * |
| 3535 | L4_MABX_B.Divide_c; |
| 3536 | |
| 3537 | /* Sum: '<S840>/Subtract1' incorporates: |
| 3538 | * Constant: '<S840>/Constant1' |
| 3539 | */ |
| 3540 | L4_MABX_B.Subtract1_f = L4_MABX_P.Constant1_Value_cju - L4_MABX_B.Divide_c; |
| 3541 | |
| 3542 | /* UnitDelay: '<S840>/Unit_Delay2' */ |
| 3543 | L4_MABX_B.Unit_Delay2_f = L4_MABX_DW.Unit_Delay2_DSTATE_g; |
| 3544 | |
| 3545 | /* Product: '<S840>/Product1' */ |
| 3546 | L4_MABX_B.Product1_e = L4_MABX_B.Subtract1_f * L4_MABX_B.Unit_Delay2_f; |
| 3547 | |
| 3548 | /* Sum: '<S840>/Add1' */ |
| 3549 | L4_MABX_B.Add1_p = L4_MABX_B.Product2_e + L4_MABX_B.Product1_e; |
| 3550 | |
| 3551 | /* Outputs for Atomic SubSystem: '<S840>/If_Then_Else' */ |
| 3552 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_p, |
| 3553 | L4_MABX_B.Pedal_2_pwm_freq_raw_value, L4_MABX_B.Add1_p, |
| 3554 | &L4_MABX_B.If_Then_Else_b); |
| 3555 | |
| 3556 | /* End of Outputs for SubSystem: '<S840>/If_Then_Else' */ |
| 3557 | |
| 3558 | /* Lookup_n-D: '<S772>/PEDAL_PWM_ANGLE_SENS_2_MPV' */ |
| 3559 | L4_MABX_B.Pedal_2_pwm_undefault = look1_binlcapw |
| 3560 | (L4_MABX_B.If_Then_Else_b.Switch, L4_MABX_P.PEDAL_PWM_ANGLE_SENS_2_MPV_bp01, |
| 3561 | L4_MABX_P.PEDAL_PWM_ANGLE_SENS_2_MPV_tabl, 7U); |
| 3562 | |
| 3563 | /* Sum: '<S774>/Subtract' */ |
| 3564 | L4_MABX_B.Subtract = L4_MABX_B.Pedal_1_pwm_undefault - |
| 3565 | L4_MABX_B.Pedal_2_pwm_undefault; |
| 3566 | |
| 3567 | /* Abs: '<S774>/Abs' */ |
| 3568 | L4_MABX_B.Abs = fabs(L4_MABX_B.Subtract); |
| 3569 | |
| 3570 | /* RelationalOperator: '<S776>/Compare' incorporates: |
| 3571 | * Constant: '<S776>/Constant' |
| 3572 | */ |
| 3573 | L4_MABX_B.Compare_f = (L4_MABX_B.Pedal_1_pwm_health_state == |
| 3574 | L4_MABX_P.CompareToConstant3_const_i); |
| 3575 | |
| 3576 | /* RelationalOperator: '<S832>/Compare' incorporates: |
| 3577 | * Constant: '<S832>/Constant' |
| 3578 | */ |
| 3579 | L4_MABX_B.Compare_ns = (L4_MABX_B.Pedal_2_pwm_health_state == |
| 3580 | L4_MABX_P.CompareToConstant5_const); |
| 3581 | |
| 3582 | /* Logic: '<S770>/Logical Operator7' */ |
| 3583 | L4_MABX_B.LogicalOperator7 = !L4_MABX_B.Compare_ns; |
| 3584 | |
| 3585 | /* RelationalOperator: '<S831>/Compare' incorporates: |
| 3586 | * Constant: '<S831>/Constant' |
| 3587 | */ |
| 3588 | L4_MABX_B.Compare_o = (L4_MABX_B.Pedal_2_pwm_health_state == |
| 3589 | L4_MABX_P.CompareToConstant4_const); |
| 3590 | |
| 3591 | /* Logic: '<S770>/Logical Operator8' */ |
| 3592 | L4_MABX_B.LogicalOperator8 = !L4_MABX_B.Compare_o; |
| 3593 | |
| 3594 | /* UnitDelay: '<S838>/FixPt Unit Delay2' */ |
| 3595 | L4_MABX_B.FixPtUnitDelay2_h = L4_MABX_DW.FixPtUnitDelay2_DSTATE_d1; |
| 3596 | |
| 3597 | /* UnitDelay: '<S838>/FixPt Unit Delay1' */ |
| 3598 | L4_MABX_B.Xold_pw = L4_MABX_DW.FixPtUnitDelay1_DSTATE_n; |
| 3599 | |
| 3600 | /* Switch: '<S838>/Init' incorporates: |
| 3601 | * Constant: '<S750>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' |
| 3602 | */ |
| 3603 | if (L4_MABX_B.FixPtUnitDelay2_h != 0) { |
| 3604 | L4_MABX_B.Init_g = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL; |
| 3605 | } else { |
| 3606 | L4_MABX_B.Init_g = L4_MABX_B.Xold_pw; |
| 3607 | } |
| 3608 | |
| 3609 | /* End of Switch: '<S838>/Init' */ |
| 3610 | |
| 3611 | /* Outputs for Atomic SubSystem: '<S770>/If_Then_Else3' */ |
| 3612 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator8, |
| 3613 | L4_MABX_B.Pedal_2_pwm_undefault, L4_MABX_B.Init_g, |
| 3614 | &L4_MABX_B.If_Then_Else3_c); |
| 3615 | |
| 3616 | /* End of Outputs for SubSystem: '<S770>/If_Then_Else3' */ |
| 3617 | |
| 3618 | /* Outputs for Atomic SubSystem: '<S770>/If_Then_Else2' */ |
| 3619 | |
| 3620 | /* Constant: '<S750>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' */ |
| 3621 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator7, |
| 3622 | L4_MABX_B.If_Then_Else3_c.Switch, |
| 3623 | L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL, |
| 3624 | &L4_MABX_B.If_Then_Else2_k); |
| 3625 | |
| 3626 | /* End of Outputs for SubSystem: '<S770>/If_Then_Else2' */ |
| 3627 | |
| 3628 | /* RelationalOperator: '<S830>/Compare' incorporates: |
| 3629 | * Constant: '<S830>/Constant' |
| 3630 | */ |
| 3631 | L4_MABX_B.Compare_h = (L4_MABX_B.Pedal_1_pwm_health_state == |
| 3632 | L4_MABX_P.CompareToConstant3_const_d); |
| 3633 | |
| 3634 | /* Logic: '<S770>/Logical Operator5' */ |
| 3635 | L4_MABX_B.LogicalOperator5 = !L4_MABX_B.Compare_h; |
| 3636 | |
| 3637 | /* RelationalOperator: '<S829>/Compare' incorporates: |
| 3638 | * Constant: '<S829>/Constant' |
| 3639 | */ |
| 3640 | L4_MABX_B.Compare_m = (L4_MABX_B.Pedal_1_pwm_health_state == |
| 3641 | L4_MABX_P.CompareToConstant1_const_j2); |
| 3642 | |
| 3643 | /* Logic: '<S770>/Logical Operator6' */ |
| 3644 | L4_MABX_B.LogicalOperator6 = !L4_MABX_B.Compare_m; |
| 3645 | |
| 3646 | /* UnitDelay: '<S837>/FixPt Unit Delay2' */ |
| 3647 | L4_MABX_B.FixPtUnitDelay2_iq = L4_MABX_DW.FixPtUnitDelay2_DSTATE_g; |
| 3648 | |
| 3649 | /* UnitDelay: '<S837>/FixPt Unit Delay1' */ |
| 3650 | L4_MABX_B.Xold_n = L4_MABX_DW.FixPtUnitDelay1_DSTATE_j; |
| 3651 | |
| 3652 | /* Switch: '<S837>/Init' incorporates: |
| 3653 | * Constant: '<S750>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' |
| 3654 | */ |
| 3655 | if (L4_MABX_B.FixPtUnitDelay2_iq != 0) { |
| 3656 | L4_MABX_B.Init_p = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL; |
| 3657 | } else { |
| 3658 | L4_MABX_B.Init_p = L4_MABX_B.Xold_n; |
| 3659 | } |
| 3660 | |
| 3661 | /* End of Switch: '<S837>/Init' */ |
| 3662 | |
| 3663 | /* Outputs for Atomic SubSystem: '<S770>/If_Then_Else1' */ |
| 3664 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator6, |
| 3665 | L4_MABX_B.Pedal_1_pwm_undefault, L4_MABX_B.Init_p, |
| 3666 | &L4_MABX_B.If_Then_Else1_c); |
| 3667 | |
| 3668 | /* End of Outputs for SubSystem: '<S770>/If_Then_Else1' */ |
| 3669 | |
| 3670 | /* Outputs for Atomic SubSystem: '<S770>/If_Then_Else' */ |
| 3671 | |
| 3672 | /* Constant: '<S750>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' */ |
| 3673 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator5, |
| 3674 | L4_MABX_B.If_Then_Else1_c.Switch, |
| 3675 | L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL, |
| 3676 | &L4_MABX_B.If_Then_Else_l); |
| 3677 | |
| 3678 | /* End of Outputs for SubSystem: '<S770>/If_Then_Else' */ |
| 3679 | |
| 3680 | /* Outputs for Atomic SubSystem: '<S768>/If_Then_Else1' */ |
| 3681 | L4_MABX_If_Then_Else(L4_MABX_B.Compare_f, L4_MABX_B.If_Then_Else2_k.Switch, |
| 3682 | L4_MABX_B.If_Then_Else_l.Switch, &L4_MABX_B.If_Then_Else1); |
| 3683 | |
| 3684 | /* End of Outputs for SubSystem: '<S768>/If_Then_Else1' */ |
| 3685 | |
| 3686 | /* RelationalOperator: '<S775>/Compare' incorporates: |
| 3687 | * Constant: '<S775>/Constant' |
| 3688 | */ |
| 3689 | L4_MABX_B.Compare_hn = (L4_MABX_B.Pedal_2_pwm_health_state == |
| 3690 | L4_MABX_P.CompareToConstant1_const_k); |
| 3691 | |
| 3692 | /* Outputs for Atomic SubSystem: '<S768>/If_Then_Else2' */ |
| 3693 | L4_MABX_If_Then_Else(L4_MABX_B.Compare_hn, L4_MABX_B.If_Then_Else_l.Switch, |
| 3694 | L4_MABX_B.If_Then_Else2_k.Switch, |
| 3695 | &L4_MABX_B.If_Then_Else2); |
| 3696 | |
| 3697 | /* End of Outputs for SubSystem: '<S768>/If_Then_Else2' */ |
| 3698 | |
| 3699 | /* MinMax: '<S768>/MinMax' */ |
| 3700 | DeltaTime = L4_MABX_B.If_Then_Else1.Switch; |
| 3701 | PositionFinalLimited = L4_MABX_B.If_Then_Else2.Switch; |
| 3702 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 3703 | PositionFinalLimited = DeltaTime; |
| 3704 | } |
| 3705 | |
| 3706 | L4_MABX_B.MinMax = PositionFinalLimited; |
| 3707 | |
| 3708 | /* End of MinMax: '<S768>/MinMax' */ |
| 3709 | |
| 3710 | /* Outputs for Atomic SubSystem: '<S768>/If_Then_Else' */ |
| 3711 | |
| 3712 | /* Constant: '<S750>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' */ |
| 3713 | L4_MABX_If_Then_Else(L4_MABX_B.F_Pedal_pwm_sens_total_failure, |
| 3714 | L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL, |
| 3715 | L4_MABX_B.MinMax, &L4_MABX_B.If_Then_Else_o); |
| 3716 | |
| 3717 | /* End of Outputs for SubSystem: '<S768>/If_Then_Else' */ |
| 3718 | |
| 3719 | /* Lookup_n-D: '<S774>/PEDAL_PWM_ANGLE_DEV_MPV' */ |
| 3720 | L4_MABX_B.PEDAL_PWM_ANGLE_DEV_MPV = look1_binlcapw |
| 3721 | (L4_MABX_B.If_Then_Else_o.Switch, L4_MABX_P.PEDAL_PWM_ANGLE_DEV_MPV_bp01Dat, |
| 3722 | L4_MABX_P.PEDAL_PWM_ANGLE_DEV_MPV_tableDa, 7U); |
| 3723 | |
| 3724 | /* RelationalOperator: '<S774>/Relational Operator' */ |
| 3725 | L4_MABX_B.F_Pedal_pwm_sync_fault = (L4_MABX_B.Abs > |
| 3726 | L4_MABX_B.PEDAL_PWM_ANGLE_DEV_MPV); |
| 3727 | |
| 3728 | /* DataTypeConversion: '<S769>/Data Type Conversion2' */ |
| 3729 | L4_MABX_B.DataTypeConversion2 = L4_MABX_B.F_Pedal_pwm_sync_fault; |
| 3730 | |
| 3731 | /* RelationalOperator: '<S821>/min_relop' incorporates: |
| 3732 | * Constant: '<S769>/PWMSynchRngMin' |
| 3733 | */ |
| 3734 | L4_MABX_B.min_relop_c = (L4_MABX_P.PWMSynchRngMin_Value < |
| 3735 | L4_MABX_B.DataTypeConversion2); |
| 3736 | |
| 3737 | /* RelationalOperator: '<S821>/max_relop' incorporates: |
| 3738 | * Constant: '<S769>/PWMSynchRngMax' |
| 3739 | */ |
| 3740 | L4_MABX_B.max_relop_o = (L4_MABX_B.DataTypeConversion2 < |
| 3741 | L4_MABX_P.PWMSynchRngMax_Value); |
| 3742 | |
| 3743 | /* Logic: '<S821>/conjunction' */ |
| 3744 | L4_MABX_B.conjunction_h = (L4_MABX_B.min_relop_c && L4_MABX_B.max_relop_o); |
| 3745 | |
| 3746 | /* UnitDelay: '<S826>/FixPt Unit Delay2' */ |
| 3747 | L4_MABX_B.FixPtUnitDelay2_nv = L4_MABX_DW.FixPtUnitDelay2_DSTATE_k; |
| 3748 | |
| 3749 | /* UnitDelay: '<S826>/FixPt Unit Delay1' */ |
| 3750 | L4_MABX_B.Xold_n0 = L4_MABX_DW.FixPtUnitDelay1_DSTATE_e5; |
| 3751 | |
| 3752 | /* Switch: '<S826>/Init' incorporates: |
| 3753 | * Constant: '<S769>/PWMSynchFaultLimMin' |
| 3754 | */ |
| 3755 | if (L4_MABX_B.FixPtUnitDelay2_nv != 0) { |
| 3756 | L4_MABX_B.Init_e = L4_MABX_P.PWMSynchFaultLimMin_Value; |
| 3757 | } else { |
| 3758 | L4_MABX_B.Init_e = L4_MABX_B.Xold_n0; |
| 3759 | } |
| 3760 | |
| 3761 | /* End of Switch: '<S826>/Init' */ |
| 3762 | |
| 3763 | /* Sum: '<S822>/FixPt Sum1' incorporates: |
| 3764 | * Constant: '<S822>/FixPt Constant' |
| 3765 | */ |
| 3766 | L4_MABX_B.FixPtSum1_f = L4_MABX_B.Init_e - L4_MABX_P.FixPtConstant_Value_by; |
| 3767 | |
| 3768 | /* Sum: '<S825>/FixPt Sum1' incorporates: |
| 3769 | * Constant: '<S825>/FixPt Constant' |
| 3770 | */ |
| 3771 | L4_MABX_B.FixPtSum1_l = L4_MABX_B.Init_e + L4_MABX_P.FixPtConstant_Value_oy; |
| 3772 | |
| 3773 | /* Outputs for Atomic SubSystem: '<S788>/If_Then_Else3' */ |
| 3774 | L4_MABX_If_Then_Else(L4_MABX_B.conjunction_h, L4_MABX_B.FixPtSum1_f, |
| 3775 | L4_MABX_B.FixPtSum1_l, &L4_MABX_B.If_Then_Else3_fz); |
| 3776 | |
| 3777 | /* End of Outputs for SubSystem: '<S788>/If_Then_Else3' */ |
| 3778 | |
| 3779 | /* RelationalOperator: '<S823>/Relational Operator1' incorporates: |
| 3780 | * Constant: '<S769>/PWMSynchFaultLimMax' |
| 3781 | */ |
| 3782 | L4_MABX_B.RelationalOperator1_g = (L4_MABX_B.If_Then_Else3_fz.Switch >= |
| 3783 | L4_MABX_P.PWMSynchFaultLimMax_Value); |
| 3784 | |
| 3785 | /* RelationalOperator: '<S823>/Relational Operator' incorporates: |
| 3786 | * Constant: '<S769>/PWMSynchFaultLimMin' |
| 3787 | */ |
| 3788 | L4_MABX_B.RelationalOperator_h = (L4_MABX_B.If_Then_Else3_fz.Switch <= |
| 3789 | L4_MABX_P.PWMSynchFaultLimMin_Value); |
| 3790 | |
| 3791 | /* Outputs for Atomic SubSystem: '<S823>/If_Then_Else1' */ |
| 3792 | |
| 3793 | /* Constant: '<S769>/PWMSynchFaultLimMin' */ |
| 3794 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_h, |
| 3795 | L4_MABX_P.PWMSynchFaultLimMin_Value, |
| 3796 | L4_MABX_B.If_Then_Else3_fz.Switch, |
| 3797 | &L4_MABX_B.If_Then_Else1_o); |
| 3798 | |
| 3799 | /* End of Outputs for SubSystem: '<S823>/If_Then_Else1' */ |
| 3800 | |
| 3801 | /* Outputs for Atomic SubSystem: '<S823>/If_Then_Else' */ |
| 3802 | |
| 3803 | /* Constant: '<S769>/PWMSynchFaultLimMax' */ |
| 3804 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_g, |
| 3805 | L4_MABX_P.PWMSynchFaultLimMax_Value, |
| 3806 | L4_MABX_B.If_Then_Else1_o.Switch, |
| 3807 | &L4_MABX_B.If_Then_Else_j); |
| 3808 | |
| 3809 | /* End of Outputs for SubSystem: '<S823>/If_Then_Else' */ |
| 3810 | |
| 3811 | /* RelationalOperator: '<S788>/Relational Operator8' incorporates: |
| 3812 | * Constant: '<S769>/PWMSynchFaultLimMax' |
| 3813 | */ |
| 3814 | L4_MABX_B.F_Fault_Hard_pe = (L4_MABX_P.PWMSynchFaultLimMax_Value <= |
| 3815 | L4_MABX_B.If_Then_Else_j.Switch); |
| 3816 | |
| 3817 | /* Logic: '<S750>/Logical Operator6' */ |
| 3818 | L4_MABX_B.LogicalOperator6_o = (L4_MABX_B.F_Pedal_pwm_sens_total_failure || |
| 3819 | L4_MABX_B.F_Fault_Hard_pe); |
| 3820 | |
| 3821 | /* Outputs for Enabled SubSystem: '<S750>/Slew_at_event' incorporates: |
| 3822 | * EnablePort: '<S773>/Enable' |
| 3823 | */ |
| 3824 | /* Constant: '<S750>/F_PEDAL_TORQUE_SLEW_AT_FAULT' */ |
| 3825 | if (L4_MABX_P.F_PEDAL_TORQUE_SLEW_AT_FAULT_Va) { |
| 3826 | if (!L4_MABX_DW.Slew_at_event_MODE) { |
| 3827 | /* InitializeConditions for UnitDelay: '<S844>/Unit_Delay' */ |
| 3828 | L4_MABX_DW.Unit_Delay_DSTATE_jr = |
| 3829 | L4_MABX_P.Unit_Delay_InitialCondition_e2j; |
| 3830 | |
| 3831 | /* InitializeConditions for UnitDelay: '<S845>/Unit_Delay' */ |
| 3832 | L4_MABX_DW.Unit_Delay_DSTATE_jz = L4_MABX_P.Unit_Delay_InitialCondition_g1; |
| 3833 | |
| 3834 | /* InitializeConditions for UnitDelay: '<S848>/FixPt Unit Delay2' */ |
| 3835 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_b = |
| 3836 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_a4; |
| 3837 | |
| 3838 | /* InitializeConditions for UnitDelay: '<S848>/FixPt Unit Delay1' */ |
| 3839 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_o = |
| 3840 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_i; |
| 3841 | |
| 3842 | /* InitializeConditions for UnitDelay: '<S843>/Unit_Delay' */ |
| 3843 | L4_MABX_DW.Unit_Delay_DSTATE_hg = L4_MABX_P.Unit_Delay_InitialCondition_nk; |
| 3844 | L4_MABX_DW.Slew_at_event_MODE = true; |
| 3845 | } |
| 3846 | |
| 3847 | /* UnitDelay: '<S844>/Unit_Delay' */ |
| 3848 | L4_MABX_B.Unit_Delay_fgg = L4_MABX_DW.Unit_Delay_DSTATE_jr; |
| 3849 | |
| 3850 | /* Logic: '<S844>/Logical Operator1' */ |
| 3851 | L4_MABX_B.LogicalOperator1_a = !L4_MABX_B.Unit_Delay_fgg; |
| 3852 | |
| 3853 | /* Logic: '<S844>/Logical Operator' */ |
| 3854 | L4_MABX_B.LogicalOperator_k = (L4_MABX_B.LogicalOperator6_o && |
| 3855 | L4_MABX_B.LogicalOperator1_a); |
| 3856 | |
| 3857 | /* UnitDelay: '<S845>/Unit_Delay' */ |
| 3858 | L4_MABX_B.Unit_Delay_jr = L4_MABX_DW.Unit_Delay_DSTATE_jz; |
| 3859 | |
| 3860 | /* Logic: '<S845>/Logical Operator1' */ |
| 3861 | L4_MABX_B.LogicalOperator1_l = (L4_MABX_B.LogicalOperator_k || |
| 3862 | L4_MABX_B.Unit_Delay_jr); |
| 3863 | |
| 3864 | /* UnitDelay: '<S848>/FixPt Unit Delay2' */ |
| 3865 | L4_MABX_B.FixPtUnitDelay2_k = L4_MABX_DW.FixPtUnitDelay2_DSTATE_b; |
| 3866 | |
| 3867 | /* UnitDelay: '<S848>/FixPt Unit Delay1' */ |
| 3868 | L4_MABX_B.Xold_d = L4_MABX_DW.FixPtUnitDelay1_DSTATE_o; |
| 3869 | |
| 3870 | /* Switch: '<S848>/Init' incorporates: |
| 3871 | * Constant: '<S750>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' |
| 3872 | */ |
| 3873 | if (L4_MABX_B.FixPtUnitDelay2_k != 0) { |
| 3874 | L4_MABX_B.Init_c = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL; |
| 3875 | } else { |
| 3876 | L4_MABX_B.Init_c = L4_MABX_B.Xold_d; |
| 3877 | } |
| 3878 | |
| 3879 | /* End of Switch: '<S848>/Init' */ |
| 3880 | |
| 3881 | /* Abs: '<S845>/Abs' incorporates: |
| 3882 | * Constant: '<S750>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_SLEW_UP' |
| 3883 | */ |
| 3884 | L4_MABX_B.Abs_k = fabs(L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFA_k); |
| 3885 | |
| 3886 | /* Product: '<S845>/Product1' incorporates: |
| 3887 | * Constant: '<S750>/PEDAL_PWM_SENSOR_DATA_APV.DT' |
| 3888 | */ |
| 3889 | L4_MABX_B.Product1_m = L4_MABX_B.Abs_k * |
| 3890 | L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDT_Val; |
| 3891 | |
| 3892 | /* Sum: '<S845>/Add1' */ |
| 3893 | L4_MABX_B.Add1_h = L4_MABX_B.Init_c + L4_MABX_B.Product1_m; |
| 3894 | |
| 3895 | /* MinMax: '<S845>/MinMax2' incorporates: |
| 3896 | * Constant: '<S750>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' |
| 3897 | */ |
| 3898 | DeltaTime = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL; |
| 3899 | PositionFinalLimited = L4_MABX_B.Add1_h; |
| 3900 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 3901 | PositionFinalLimited = DeltaTime; |
| 3902 | } |
| 3903 | |
| 3904 | L4_MABX_B.MinMax2 = PositionFinalLimited; |
| 3905 | |
| 3906 | /* End of MinMax: '<S845>/MinMax2' */ |
| 3907 | |
| 3908 | /* Abs: '<S845>/Abs1' incorporates: |
| 3909 | * Constant: '<S750>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_SLEW_DOWN' |
| 3910 | */ |
| 3911 | L4_MABX_B.Abs1 = fabs(L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFA_b); |
| 3912 | |
| 3913 | /* Product: '<S845>/Product2' incorporates: |
| 3914 | * Constant: '<S750>/PEDAL_PWM_SENSOR_DATA_APV.DT' |
| 3915 | */ |
| 3916 | L4_MABX_B.Product2_d = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDT_Val * |
| 3917 | L4_MABX_B.Abs1; |
| 3918 | |
| 3919 | /* Sum: '<S845>/Subtract1' */ |
| 3920 | L4_MABX_B.Subtract1_p = L4_MABX_B.Init_c - L4_MABX_B.Product2_d; |
| 3921 | |
| 3922 | /* MinMax: '<S845>/MinMax1' */ |
| 3923 | DeltaTime = L4_MABX_B.MinMax2; |
| 3924 | PositionFinalLimited = L4_MABX_B.Subtract1_p; |
| 3925 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 3926 | PositionFinalLimited = DeltaTime; |
| 3927 | } |
| 3928 | |
| 3929 | L4_MABX_B.MinMax1_e = PositionFinalLimited; |
| 3930 | |
| 3931 | /* End of MinMax: '<S845>/MinMax1' */ |
| 3932 | |
| 3933 | /* Outputs for Atomic SubSystem: '<S845>/If_Then_Else' */ |
| 3934 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_l, |
| 3935 | L4_MABX_B.If_Then_Else_o.Switch, L4_MABX_B.MinMax1_e, |
| 3936 | &L4_MABX_B.If_Then_Else_or); |
| 3937 | |
| 3938 | /* End of Outputs for SubSystem: '<S845>/If_Then_Else' */ |
| 3939 | |
| 3940 | /* Sum: '<S773>/Subtract' incorporates: |
| 3941 | * Constant: '<S750>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' |
| 3942 | */ |
| 3943 | L4_MABX_B.Subtract_j = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL - |
| 3944 | L4_MABX_B.If_Then_Else_or.Switch; |
| 3945 | |
| 3946 | /* Abs: '<S773>/Abs' */ |
| 3947 | L4_MABX_B.Abs_i = fabs(L4_MABX_B.Subtract_j); |
| 3948 | |
| 3949 | /* RelationalOperator: '<S773>/Relational Operator1' incorporates: |
| 3950 | * Constant: '<S773>/Constant1' |
| 3951 | */ |
| 3952 | L4_MABX_B.RelationalOperator1_g4 = (L4_MABX_B.Abs_i <= |
| 3953 | L4_MABX_P.Constant1_Value_b); |
| 3954 | |
| 3955 | /* Logic: '<S843>/Logical Operator3' */ |
| 3956 | L4_MABX_B.LogicalOperator3_b = !L4_MABX_B.RelationalOperator1_g4; |
| 3957 | |
| 3958 | /* UnitDelay: '<S843>/Unit_Delay' */ |
| 3959 | L4_MABX_B.Unit_Delay_h = L4_MABX_DW.Unit_Delay_DSTATE_hg; |
| 3960 | |
| 3961 | /* Logic: '<S843>/Logical Operator1' */ |
| 3962 | L4_MABX_B.LogicalOperator1_g = (L4_MABX_B.LogicalOperator6_o || |
| 3963 | L4_MABX_B.Unit_Delay_h); |
| 3964 | |
| 3965 | /* Logic: '<S843>/Logical Operator' */ |
| 3966 | L4_MABX_B.LogicalOperator_np = (L4_MABX_B.LogicalOperator3_b && |
| 3967 | L4_MABX_B.LogicalOperator1_g); |
| 3968 | |
| 3969 | /* Logic: '<S843>/Logical Operator2' */ |
| 3970 | L4_MABX_B.LogicalOperator2_i = !L4_MABX_B.LogicalOperator_np; |
| 3971 | |
| 3972 | /* RelationalOperator: '<S846>/min_relop' incorporates: |
| 3973 | * Constant: '<S750>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_SLEW_UP' |
| 3974 | * Constant: '<S846>/min_val' |
| 3975 | */ |
| 3976 | L4_MABX_B.min_relop_b = (L4_MABX_P.CheckStaticLowerBound_min_a <= |
| 3977 | L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFA_k); |
| 3978 | |
| 3979 | /* Assertion: '<S846>/Assertion' */ |
| 3980 | utAssert(L4_MABX_B.min_relop_b); |
| 3981 | } else { |
| 3982 | if (L4_MABX_DW.Slew_at_event_MODE) { |
| 3983 | /* Disable for Outport: '<S773>/F_Out_slewing' */ |
| 3984 | L4_MABX_B.LogicalOperator_np = L4_MABX_P.F_Out_slewing_Y0_a; |
| 3985 | |
| 3986 | /* Disable for Outport: '<S773>/Out' */ |
| 3987 | L4_MABX_B.If_Then_Else_or.Switch = L4_MABX_P.Out_Y0_h; |
| 3988 | L4_MABX_DW.Slew_at_event_MODE = false; |
| 3989 | } |
| 3990 | } |
| 3991 | |
| 3992 | /* End of Constant: '<S750>/F_PEDAL_TORQUE_SLEW_AT_FAULT' */ |
| 3993 | /* End of Outputs for SubSystem: '<S750>/Slew_at_event' */ |
| 3994 | |
| 3995 | /* Outputs for Atomic SubSystem: '<S750>/If_Then_Else' */ |
| 3996 | L4_MABX_If_Then_Else_kn(L4_MABX_B.LogicalOperator_np, |
| 3997 | L4_MABX_B.If_Then_Else_or.Switch, L4_MABX_B.If_Then_Else_o.Switch); |
| 3998 | |
| 3999 | /* End of Outputs for SubSystem: '<S750>/If_Then_Else' */ |
| 4000 | |
| 4001 | /* S-Function (rti_commonblock): '<S738>/S-Function1' */ |
| 4002 | /* This comment workarounds a code generation problem */ |
| 4003 | { |
| 4004 | /* dSPACE I/O Board DS1401STDADCT4 #1 Unit:ADC Group:ADC */ |
| 4005 | adc_tp4_single_new_read(ADC_TP4_1_MODULE_ADDR, |
| 4006 | ADC_TP4_CH3, |
| 4007 | (dsfloat *)&L4_MABX_B.SFunction1); |
| 4008 | } |
| 4009 | |
| 4010 | /* Gain: '<S422>/KL15_Monitor' */ |
| 4011 | L4_MABX_B.IgnitionKeySwitch_voltage = L4_MABX_P.KL15_Monitor_Gain * |
| 4012 | L4_MABX_B.SFunction1; |
| 4013 | |
| 4014 | /* Outputs for Enabled SubSystem: '<S513>/CCVS1_31' incorporates: |
| 4015 | * EnablePort: '<S514>/Enable' |
| 4016 | */ |
| 4017 | /* Constant: '<S436>/Constant' */ |
| 4018 | if (L4_MABX_P.Constant_Value_ab) { |
| 4019 | /* S-Function (rti_commonblock): '<S514>/S-Function1' */ |
| 4020 | /* This comment workarounds a code generation problem */ |
| 4021 | |
| 4022 | /* dSPACE RTICAN RX Message Block: "CCVS1_31" Id:419361073 */ |
| 4023 | { |
| 4024 | UInt32 *CAN_Msg; |
| 4025 | static dsfloat time_old = 0.0; |
| 4026 | |
| 4027 | /* Read status and timestamp info (previous message) */ |
| 4028 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF131].timestamp != |
| 4029 | time_old) { |
| 4030 | /* ... save timestamp info for the calculation of the RX status |
| 4031 | during the consecutive sample hit*/ |
| 4032 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF131]. |
| 4033 | timestamp; |
| 4034 | |
| 4035 | /* ... set the processed flag to one */ |
| 4036 | L4_MABX_B.SFunction1_o21_e = 1.0; |
| 4037 | L4_MABX_B.SFunction1_o22_ih = (real_T) |
| 4038 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF131].timestamp; |
| 4039 | L4_MABX_B.SFunction1_o23_i = (real_T) |
| 4040 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF131].deltatime; |
| 4041 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF131].data; |
| 4042 | |
| 4043 | /* Decode CAN message */ |
| 4044 | { |
| 4045 | { |
| 4046 | rtican_Signal_t CAN_Sgn; |
| 4047 | |
| 4048 | /* ...... "TwoSpeedAxleSwitch" (0|2, standard signal, unsigned int, little endian) */ |
| 4049 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4050 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4051 | L4_MABX_B.SFunction1_o1_kp = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4052 | |
| 4053 | /* ...... "ParkingBrakeSwitch" (2|2, standard signal, unsigned int, little endian) */ |
| 4054 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4055 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4056 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4057 | L4_MABX_B.SFunction1_o2_bl = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4058 | |
| 4059 | /* ...... "CruiseCtrlPauseSwitch" (4|2, standard signal, unsigned int, little endian) */ |
| 4060 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4061 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4062 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4063 | L4_MABX_B.SFunction1_o3_g2 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4064 | |
| 4065 | /* ...... "ParkBrakeReleaseInhibitRq" (6|2, standard signal, unsigned int, little endian) */ |
| 4066 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4067 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4068 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4069 | L4_MABX_B.SFunction1_o4_bx = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4070 | |
| 4071 | /* ...... "WheelBasedVehicleSpeed" (8|16, standard signal, unsigned int, little endian) */ |
| 4072 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 4073 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 4074 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4075 | L4_MABX_B.SFunction1_o5_p1 = 0.00390625 * ( ((real_T) |
| 4076 | CAN_Sgn.UnsignedSgn) ); |
| 4077 | |
| 4078 | /* ...... "CruiseCtrlActive" (24|2, standard signal, unsigned int, little endian) */ |
| 4079 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4080 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4081 | L4_MABX_B.SFunction1_o6_pt = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4082 | |
| 4083 | /* ...... "CruiseCtrlEnableSwitch" (26|2, standard signal, unsigned int, little endian) */ |
| 4084 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4085 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4086 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4087 | L4_MABX_B.SFunction1_o7_g = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4088 | |
| 4089 | /* ...... "BrakeSwitch" (28|2, standard signal, unsigned int, little endian) */ |
| 4090 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4091 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4092 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4093 | L4_MABX_B.SFunction1_o8_fp = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4094 | |
| 4095 | /* ...... "ClutchSwitch" (30|2, standard signal, unsigned int, little endian) */ |
| 4096 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4097 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4098 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4099 | L4_MABX_B.SFunction1_o9_gg = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4100 | |
| 4101 | /* ...... "CruiseCtrlSetSwitch" (32|2, standard signal, unsigned int, little endian) */ |
| 4102 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4103 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4104 | L4_MABX_B.SFunction1_o10_cf = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4105 | |
| 4106 | /* ...... "CruiseCtrlCoastSwitch" (34|2, standard signal, unsigned int, little endian) */ |
| 4107 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4108 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4109 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4110 | L4_MABX_B.SFunction1_o11_dy = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4111 | |
| 4112 | /* ...... "CruiseCtrlResumeSwitch" (36|2, standard signal, unsigned int, little endian) */ |
| 4113 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4114 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4115 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4116 | L4_MABX_B.SFunction1_o12_j = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4117 | |
| 4118 | /* ...... "CruiseCtrlAccelerateSwitch" (38|2, standard signal, unsigned int, little endian) */ |
| 4119 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4120 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4121 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4122 | L4_MABX_B.SFunction1_o13_og = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4123 | |
| 4124 | /* ...... "CruiseCtrlSetSpeed" (40|8, standard signal, unsigned int, little endian) */ |
| 4125 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 4126 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4127 | L4_MABX_B.SFunction1_o14_p = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4128 | |
| 4129 | /* ...... "PTOGovernorState" (48|5, standard signal, unsigned int, little endian) */ |
| 4130 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4131 | CAN_Sgn.UnsignedSgn &= 0x0000001F; |
| 4132 | L4_MABX_B.SFunction1_o15_h = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4133 | |
| 4134 | /* ...... "CruiseCtrlStates" (53|3, standard signal, unsigned int, little endian) */ |
| 4135 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4136 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 5; |
| 4137 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 4138 | L4_MABX_B.SFunction1_o16_m = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4139 | |
| 4140 | /* ...... "EngIdleIncrementSwitch" (56|2, standard signal, unsigned int, little endian) */ |
| 4141 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4142 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4143 | L4_MABX_B.SFunction1_o17_k = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4144 | |
| 4145 | /* ...... "EngIdleDecrementSwitch" (58|2, standard signal, unsigned int, little endian) */ |
| 4146 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4147 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4148 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4149 | L4_MABX_B.SFunction1_o18_a = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4150 | |
| 4151 | /* ...... "EngTestModeSwitch" (60|2, standard signal, unsigned int, little endian) */ |
| 4152 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4153 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4154 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4155 | L4_MABX_B.SFunction1_o19_i = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4156 | |
| 4157 | /* ...... "EngShutdownOverrideSwitch" (62|2, standard signal, unsigned int, little endian) */ |
| 4158 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4159 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4160 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4161 | L4_MABX_B.SFunction1_o20_i = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4162 | } |
| 4163 | } |
| 4164 | } else { |
| 4165 | /* set RX status to 0 because no new message has arrived */ |
| 4166 | L4_MABX_B.SFunction1_o21_e = 0.0; |
| 4167 | } |
| 4168 | } |
| 4169 | } |
| 4170 | |
| 4171 | /* End of Constant: '<S436>/Constant' */ |
| 4172 | /* End of Outputs for SubSystem: '<S513>/CCVS1_31' */ |
| 4173 | |
| 4174 | /* Outputs for Enabled SubSystem: '<S524>/EBC2_0B1' incorporates: |
| 4175 | * EnablePort: '<S525>/Enable' |
| 4176 | */ |
| 4177 | /* Constant: '<S441>/Enable_RX_EBC2_0B' */ |
| 4178 | if (L4_MABX_P.Enable_RX_EBC2_0B_Value) { |
| 4179 | /* S-Function (rti_commonblock): '<S525>/S-Function1' */ |
| 4180 | /* This comment workarounds a code generation problem */ |
| 4181 | |
| 4182 | /* dSPACE RTICAN RX Message Block: "EBC2_0B" Id:419348235 */ |
| 4183 | { |
| 4184 | UInt32 *CAN_Msg; |
| 4185 | static dsfloat time_old = 0.0; |
| 4186 | |
| 4187 | /* Read status and timestamp info (previous message) */ |
| 4188 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEBF0B].timestamp != |
| 4189 | time_old) { |
| 4190 | /* ... save timestamp info for the calculation of the RX status |
| 4191 | during the consecutive sample hit*/ |
| 4192 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEBF0B]. |
| 4193 | timestamp; |
| 4194 | |
| 4195 | /* ... set the processed flag to one */ |
| 4196 | L4_MABX_B.SFunction1_o8_bo = 1.0; |
| 4197 | L4_MABX_B.SFunction1_o9_a = (real_T) |
| 4198 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEBF0B].timestamp; |
| 4199 | L4_MABX_B.SFunction1_o10_pk = (real_T) |
| 4200 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEBF0B].deltatime; |
| 4201 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEBF0B].data; |
| 4202 | |
| 4203 | /* Decode CAN message */ |
| 4204 | { |
| 4205 | { |
| 4206 | rtican_Signal_t CAN_Sgn; |
| 4207 | |
| 4208 | /* ...... "FrontAxleSpeed" (0|16, standard signal, unsigned int, little endian) */ |
| 4209 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4210 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 4211 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4212 | L4_MABX_B.SFunction1_o1_gd = 0.00390625 * ( ((real_T) |
| 4213 | CAN_Sgn.UnsignedSgn) ); |
| 4214 | |
| 4215 | /* ...... "RelativeSpeedFrontAxleLeftWheel" (16|8, standard signal, unsigned int, little endian) */ |
| 4216 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4217 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4218 | L4_MABX_B.SFunction1_o2_dl = -7.8125 + ( 0.0625 * ( ((real_T) |
| 4219 | CAN_Sgn.UnsignedSgn) ) ); |
| 4220 | |
| 4221 | /* ...... "RlativeSpeedFrontAxleRightWheel" (24|8, standard signal, unsigned int, little endian) */ |
| 4222 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4223 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4224 | L4_MABX_B.SFunction1_o3_hh = -7.8125 + ( 0.0625 * ( ((real_T) |
| 4225 | CAN_Sgn.UnsignedSgn) ) ); |
| 4226 | |
| 4227 | /* ...... "RelativeSpeedRearAxle1LeftWheel" (32|8, standard signal, unsigned int, little endian) */ |
| 4228 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4229 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4230 | L4_MABX_B.SFunction1_o4_cs = -7.8125 + ( 0.0625 * ( ((real_T) |
| 4231 | CAN_Sgn.UnsignedSgn) ) ); |
| 4232 | |
| 4233 | /* ...... "RlativeSpeedRearAxle1RightWheel" (40|8, standard signal, unsigned int, little endian) */ |
| 4234 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 4235 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4236 | L4_MABX_B.SFunction1_o5_o = -7.8125 + ( 0.0625 * ( ((real_T) |
| 4237 | CAN_Sgn.UnsignedSgn) ) ); |
| 4238 | |
| 4239 | /* ...... "RelativeSpeedRearAxle2LeftWheel" (48|8, standard signal, unsigned int, little endian) */ |
| 4240 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4241 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4242 | L4_MABX_B.SFunction1_o6_la = -7.8125 + ( 0.0625 * ( ((real_T) |
| 4243 | CAN_Sgn.UnsignedSgn) ) ); |
| 4244 | |
| 4245 | /* ...... "RlativeSpeedRearAxle2RightWheel" (56|8, standard signal, unsigned int, little endian) */ |
| 4246 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4247 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4248 | L4_MABX_B.SFunction1_o7_lp = -7.8125 + ( 0.0625 * ( ((real_T) |
| 4249 | CAN_Sgn.UnsignedSgn) ) ); |
| 4250 | } |
| 4251 | } |
| 4252 | } else { |
| 4253 | /* set RX status to 0 because no new message has arrived */ |
| 4254 | L4_MABX_B.SFunction1_o8_bo = 0.0; |
| 4255 | } |
| 4256 | } |
| 4257 | } |
| 4258 | |
| 4259 | /* End of Constant: '<S441>/Enable_RX_EBC2_0B' */ |
| 4260 | /* End of Outputs for SubSystem: '<S524>/EBC2_0B1' */ |
| 4261 | |
| 4262 | /* Outputs for Enabled SubSystem: '<S582>/HRW_0B' incorporates: |
| 4263 | * EnablePort: '<S583>/Enable' |
| 4264 | */ |
| 4265 | /* Constant: '<S448>/Enable_HRW_RX_0B' */ |
| 4266 | if (L4_MABX_P.Enable_HRW_RX_0B_Value) { |
| 4267 | /* S-Function (rti_commonblock): '<S583>/S-Function1' */ |
| 4268 | /* This comment workarounds a code generation problem */ |
| 4269 | |
| 4270 | /* dSPACE RTICAN RX Message Block: "HRW_0B" Id:150892043 */ |
| 4271 | { |
| 4272 | UInt32 *CAN_Msg; |
| 4273 | static dsfloat time_old = 0.0; |
| 4274 | |
| 4275 | /* Read status and timestamp info (previous message) */ |
| 4276 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x8FE6E0B].timestamp != |
| 4277 | time_old) { |
| 4278 | /* ... save timestamp info for the calculation of the RX status |
| 4279 | during the consecutive sample hit*/ |
| 4280 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x8FE6E0B]. |
| 4281 | timestamp; |
| 4282 | |
| 4283 | /* ... set the processed flag to one */ |
| 4284 | L4_MABX_B.SFunction1_o5_ij = 1.0; |
| 4285 | L4_MABX_B.SFunction1_o6_kk = (real_T) |
| 4286 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x8FE6E0B].timestamp; |
| 4287 | L4_MABX_B.SFunction1_o7_cp = (real_T) |
| 4288 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x8FE6E0B].deltatime; |
| 4289 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x8FE6E0B].data; |
| 4290 | |
| 4291 | /* Decode CAN message */ |
| 4292 | { |
| 4293 | { |
| 4294 | rtican_Signal_t CAN_Sgn; |
| 4295 | |
| 4296 | /* ...... "FrontAxleLeftWheelSpeed" (0|16, standard signal, unsigned int, little endian) */ |
| 4297 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4298 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 4299 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4300 | L4_MABX_B.SFunction1_o1_au = 0.00390625 * ( ((real_T) |
| 4301 | CAN_Sgn.UnsignedSgn) ); |
| 4302 | |
| 4303 | /* ...... "FrontAxleRightWheelSpeed" (16|16, standard signal, unsigned int, little endian) */ |
| 4304 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4305 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 4306 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4307 | L4_MABX_B.SFunction1_o2_hu = 0.00390625 * ( ((real_T) |
| 4308 | CAN_Sgn.UnsignedSgn) ); |
| 4309 | |
| 4310 | /* ...... "RearAxleLeftWheelSpeed" (32|16, standard signal, unsigned int, little endian) */ |
| 4311 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4312 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 4313 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4314 | L4_MABX_B.SFunction1_o3_pw = 0.00390625 * ( ((real_T) |
| 4315 | CAN_Sgn.UnsignedSgn) ); |
| 4316 | |
| 4317 | /* ...... "RearAxleRightWheelSpeed" (48|16, standard signal, unsigned int, little endian) */ |
| 4318 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4319 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[7]; |
| 4320 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4321 | L4_MABX_B.SFunction1_o4_auj = 0.00390625 * ( ((real_T) |
| 4322 | CAN_Sgn.UnsignedSgn) ); |
| 4323 | } |
| 4324 | } |
| 4325 | } else { |
| 4326 | /* set RX status to 0 because no new message has arrived */ |
| 4327 | L4_MABX_B.SFunction1_o5_ij = 0.0; |
| 4328 | } |
| 4329 | } |
| 4330 | } |
| 4331 | |
| 4332 | /* End of Constant: '<S448>/Enable_HRW_RX_0B' */ |
| 4333 | /* End of Outputs for SubSystem: '<S582>/HRW_0B' */ |
| 4334 | |
| 4335 | /* Outputs for Enabled SubSystem: '<S522>/EBC1_0B' incorporates: |
| 4336 | * EnablePort: '<S523>/Enable' |
| 4337 | */ |
| 4338 | /* Constant: '<S440>/Constant1' */ |
| 4339 | if (L4_MABX_P.Constant1_Value_nw) { |
| 4340 | /* S-Function (rti_commonblock): '<S523>/S-Function1' */ |
| 4341 | /* This comment workarounds a code generation problem */ |
| 4342 | |
| 4343 | /* dSPACE RTICAN RX Message Block: "EBC1_0B" Id:418382219 */ |
| 4344 | { |
| 4345 | UInt32 *CAN_Msg; |
| 4346 | static dsfloat time_old = 0.0; |
| 4347 | |
| 4348 | /* Read status and timestamp info (previous message) */ |
| 4349 | if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18F0018B].timestamp != |
| 4350 | time_old) { |
| 4351 | /* ... save timestamp info for the calculation of the RX status |
| 4352 | during the consecutive sample hit*/ |
| 4353 | time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18F0018B]. |
| 4354 | timestamp; |
| 4355 | |
| 4356 | /* ... set the processed flag to one */ |
| 4357 | L4_MABX_B.SFunction1_o23_b = 1.0; |
| 4358 | L4_MABX_B.SFunction1_o24_l = (real_T) |
| 4359 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18F0018B].timestamp; |
| 4360 | L4_MABX_B.SFunction1_o25_p = (real_T) |
| 4361 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18F0018B].deltatime; |
| 4362 | CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18F0018B].data; |
| 4363 | |
| 4364 | /* Decode CAN message */ |
| 4365 | { |
| 4366 | { |
| 4367 | rtican_Signal_t CAN_Sgn; |
| 4368 | |
| 4369 | /* ...... "ASREngCtrlActive" (0|2, standard signal, unsigned int, little endian) */ |
| 4370 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4371 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4372 | L4_MABX_B.SFunction1_o1_df = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4373 | |
| 4374 | /* ...... "ASRBrakeCtrlActive" (2|2, standard signal, unsigned int, little endian) */ |
| 4375 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4376 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4377 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4378 | L4_MABX_B.SFunction1_o2_eb = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4379 | |
| 4380 | /* ...... "AntiLockBrakingActive" (4|2, standard signal, unsigned int, little endian) */ |
| 4381 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4382 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4383 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4384 | L4_MABX_B.SFunction1_o3_kb = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4385 | |
| 4386 | /* ...... "EBSBrakeSwitch" (6|2, standard signal, unsigned int, little endian) */ |
| 4387 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4388 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4389 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4390 | L4_MABX_B.SFunction1_o4_nj = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4391 | |
| 4392 | /* ...... "BrakePedalPos" (8|8, standard signal, unsigned int, little endian) */ |
| 4393 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 4394 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4395 | L4_MABX_B.SFunction1_o5_k3 = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 4396 | |
| 4397 | /* ...... "ABSOffroadSwitch" (16|2, standard signal, unsigned int, little endian) */ |
| 4398 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4399 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4400 | L4_MABX_B.SFunction1_o6_hu = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4401 | |
| 4402 | /* ...... "ASROffroadSwitch" (18|2, standard signal, unsigned int, little endian) */ |
| 4403 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4404 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4405 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4406 | L4_MABX_B.SFunction1_o7_k = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4407 | |
| 4408 | /* ...... "ASRHillHolderSwitch" (20|2, standard signal, unsigned int, little endian) */ |
| 4409 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4410 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4411 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4412 | L4_MABX_B.SFunction1_o8_lb = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4413 | |
| 4414 | /* ...... "TractionCtrlOverrideSwitch" (22|2, standard signal, unsigned int, little endian) */ |
| 4415 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4416 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4417 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4418 | L4_MABX_B.SFunction1_o9_oz = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4419 | |
| 4420 | /* ...... "AccelInterlockSwitch" (24|2, standard signal, unsigned int, little endian) */ |
| 4421 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4422 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4423 | L4_MABX_B.SFunction1_o10_dd = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4424 | |
| 4425 | /* ...... "EngDerateSwitch" (26|2, standard signal, unsigned int, little endian) */ |
| 4426 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4427 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4428 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4429 | L4_MABX_B.SFunction1_o11_a2 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4430 | |
| 4431 | /* ...... "EngAuxShutdownSwitch" (28|2, standard signal, unsigned int, little endian) */ |
| 4432 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4433 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4434 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4435 | L4_MABX_B.SFunction1_o12_c = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4436 | |
| 4437 | /* ...... "RemoteAccelEnableSwitch" (30|2, standard signal, unsigned int, little endian) */ |
| 4438 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4439 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4440 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4441 | L4_MABX_B.SFunction1_o13_o = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4442 | |
| 4443 | /* ...... "EngRetarderSelection" (32|8, standard signal, unsigned int, little endian) */ |
| 4444 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4445 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4446 | L4_MABX_B.SFunction1_o14_l = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 4447 | |
| 4448 | /* ...... "ABSFullyOperational" (40|2, standard signal, unsigned int, little endian) */ |
| 4449 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 4450 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4451 | L4_MABX_B.SFunction1_o15_a = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4452 | |
| 4453 | /* ...... "EBSRedWarningSignal" (42|2, standard signal, unsigned int, little endian) */ |
| 4454 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 4455 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4456 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4457 | L4_MABX_B.SFunction1_o16_ed = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4458 | |
| 4459 | /* ...... "ABS_EBSAmberWarningSignal" (44|2, standard signal, unsigned int, little endian) */ |
| 4460 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 4461 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4462 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4463 | L4_MABX_B.SFunction1_o17_d = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4464 | |
| 4465 | /* ...... "ATC_ASRInformationSignal" (46|2, standard signal, unsigned int, little endian) */ |
| 4466 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 4467 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4468 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4469 | L4_MABX_B.SFunction1_o18_c = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4470 | |
| 4471 | /* ...... "SrcAddrssOfCtrllngDvcFrBrkCntrl" (48|8, standard signal, unsigned int, little endian) */ |
| 4472 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4473 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4474 | L4_MABX_B.SFunction1_o19_o = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4475 | |
| 4476 | /* ...... "HaltBrakeSwitch" (58|2, standard signal, unsigned int, little endian) */ |
| 4477 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4478 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4479 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4480 | L4_MABX_B.SFunction1_o20_e = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4481 | |
| 4482 | /* ...... "TrailerABSStatus" (60|2, standard signal, unsigned int, little endian) */ |
| 4483 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4484 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4485 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4486 | L4_MABX_B.SFunction1_o21_f = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4487 | |
| 4488 | /* ...... "TrctrMntdTrilerABSWarningSignal" (62|2, standard signal, unsigned int, little endian) */ |
| 4489 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4490 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4491 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4492 | L4_MABX_B.SFunction1_o22_o = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4493 | } |
| 4494 | } |
| 4495 | } else { |
| 4496 | /* set RX status to 0 because no new message has arrived */ |
| 4497 | L4_MABX_B.SFunction1_o23_b = 0.0; |
| 4498 | } |
| 4499 | } |
| 4500 | } |
| 4501 | |
| 4502 | /* End of Constant: '<S440>/Constant1' */ |
| 4503 | /* End of Outputs for SubSystem: '<S522>/EBC1_0B' */ |
| 4504 | |
| 4505 | /* Outputs for Enabled SubSystem: '<S577>/ETC2_031' incorporates: |
| 4506 | * EnablePort: '<S578>/Enable' |
| 4507 | */ |
| 4508 | /* Constant: '<S446>/Enable_RX_ETC2_03' */ |
| 4509 | if (L4_MABX_P.Enable_RX_ETC2_03_Value) { |
| 4510 | /* S-Function (rti_commonblock): '<S578>/S-Function1' */ |
| 4511 | /* This comment workarounds a code generation problem */ |
| 4512 | |
| 4513 | /* dSPACE RTICAN RX Message Block: "ETC2_03" Id:418383107 */ |
| 4514 | { |
| 4515 | UInt32 *CAN_Msg; |
| 4516 | static dsfloat time_old = 0.0; |
| 4517 | |
| 4518 | /* Read status and timestamp info (previous message) */ |
| 4519 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F00503].timestamp != |
| 4520 | time_old) { |
| 4521 | /* ... save timestamp info for the calculation of the RX status |
| 4522 | during the consecutive sample hit*/ |
| 4523 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F00503]. |
| 4524 | timestamp; |
| 4525 | |
| 4526 | /* ... set the processed flag to one */ |
| 4527 | L4_MABX_B.SFunction1_o4_ly = 1.0; |
| 4528 | L4_MABX_B.SFunction1_o5_e3 = (real_T) |
| 4529 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F00503].timestamp; |
| 4530 | L4_MABX_B.SFunction1_o6_o = (real_T) |
| 4531 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F00503].deltatime; |
| 4532 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F00503].data; |
| 4533 | |
| 4534 | /* Decode CAN message */ |
| 4535 | { |
| 4536 | { |
| 4537 | rtican_Signal_t CAN_Sgn; |
| 4538 | |
| 4539 | /* ...... "SPN524_TransSelectedGear" (0|8, standard signal, unsigned int, little endian) */ |
| 4540 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4541 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4542 | L4_MABX_B.SFunction1_o1_nm = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 4543 | ); |
| 4544 | |
| 4545 | /* ...... "SPN526_TransActualGearRatio" (8|16, standard signal, unsigned int, little endian) */ |
| 4546 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 4547 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 4548 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4549 | L4_MABX_B.SFunction1_o2_mp = 0.001 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 4550 | ); |
| 4551 | |
| 4552 | /* ...... "SPN523_TransCurrentGear" (24|8, standard signal, unsigned int, little endian) */ |
| 4553 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4554 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4555 | L4_MABX_B.SFunction1_o3_cn = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 4556 | ); |
| 4557 | } |
| 4558 | } |
| 4559 | } else { |
| 4560 | /* set RX status to 0 because no new message has arrived */ |
| 4561 | L4_MABX_B.SFunction1_o4_ly = 0.0; |
| 4562 | } |
| 4563 | } |
| 4564 | } |
| 4565 | |
| 4566 | /* End of Constant: '<S446>/Enable_RX_ETC2_03' */ |
| 4567 | /* End of Outputs for SubSystem: '<S577>/ETC2_031' */ |
| 4568 | |
| 4569 | /* DataTypeConversion: '<S577>/Data Type Conversion1' */ |
| 4570 | L4_MABX_B.SPN524_TransSelectedGear = L4_MABX_B.SFunction1_o1_nm; |
| 4571 | |
| 4572 | /* DataTypeConversion: '<S577>/Data Type Conversion2' */ |
| 4573 | L4_MABX_B.SPN523_TransCurrentGear = L4_MABX_B.SFunction1_o3_cn; |
| 4574 | |
| 4575 | /* DataTypeConversion: '<S577>/Data Type Conversion3' */ |
| 4576 | L4_MABX_B.SPN526_TransActualGearRatio = L4_MABX_B.SFunction1_o2_mp; |
| 4577 | |
| 4578 | /* Outputs for Enabled SubSystem: '<S571>/EEC1_001' incorporates: |
| 4579 | * EnablePort: '<S572>/Enable' |
| 4580 | */ |
| 4581 | /* Constant: '<S443>/Enable_RX_EEC1_00' */ |
| 4582 | if (L4_MABX_P.Enable_RX_EEC1_00_Value) { |
| 4583 | /* S-Function (rti_commonblock): '<S572>/S-Function1' */ |
| 4584 | /* This comment workarounds a code generation problem */ |
| 4585 | |
| 4586 | /* dSPACE RTICAN RX Message Block: "EEC1_00" Id:217056256 */ |
| 4587 | { |
| 4588 | UInt32 *CAN_Msg; |
| 4589 | static dsfloat time_old = 0.0; |
| 4590 | |
| 4591 | /* Read status and timestamp info (previous message) */ |
| 4592 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF00400].timestamp != |
| 4593 | time_old) { |
| 4594 | /* ... save timestamp info for the calculation of the RX status |
| 4595 | during the consecutive sample hit*/ |
| 4596 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF00400]. |
| 4597 | timestamp; |
| 4598 | |
| 4599 | /* ... set the processed flag to one */ |
| 4600 | L4_MABX_B.SFunction1_o9_gn = 1.0; |
| 4601 | L4_MABX_B.SFunction1_o10_b = (real_T) |
| 4602 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF00400].timestamp; |
| 4603 | L4_MABX_B.SFunction1_o11_b = (real_T) |
| 4604 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF00400].deltatime; |
| 4605 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF00400].data; |
| 4606 | |
| 4607 | /* Decode CAN message */ |
| 4608 | { |
| 4609 | { |
| 4610 | rtican_Signal_t CAN_Sgn; |
| 4611 | |
| 4612 | /* ...... "EngTorqueMode" (0|4, standard signal, unsigned int, little endian) */ |
| 4613 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4614 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 4615 | L4_MABX_B.SFunction1_o1_nr = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4616 | |
| 4617 | /* ...... "ActlEngPrcntTrqueHighResolution" (4|4, standard signal, unsigned int, little endian) */ |
| 4618 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4619 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4620 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 4621 | L4_MABX_B.SFunction1_o2_dgu = 0.125 * ( ((real_T) |
| 4622 | CAN_Sgn.UnsignedSgn) ); |
| 4623 | |
| 4624 | /* ...... "DriversDemandEngPercentTorque" (8|8, standard signal, unsigned int, little endian) */ |
| 4625 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 4626 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4627 | L4_MABX_B.SFunction1_o3_ho = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 4628 | ); |
| 4629 | |
| 4630 | /* ...... "ActualEngPercentTorque" (16|8, standard signal, unsigned int, little endian) */ |
| 4631 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4632 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4633 | L4_MABX_B.SFunction1_o4_ki = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 4634 | ); |
| 4635 | |
| 4636 | /* ...... "EngSpeed" (24|16, standard signal, unsigned int, little endian) */ |
| 4637 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4638 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 4639 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4640 | L4_MABX_B.SFunction1_o5_nl = 0.125 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 4641 | ); |
| 4642 | |
| 4643 | /* ...... "SrcAddrssOfCtrllngDvcFrEngCntrl" (40|8, standard signal, unsigned int, little endian) */ |
| 4644 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 4645 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4646 | L4_MABX_B.SFunction1_o6_hc = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4647 | |
| 4648 | /* ...... "EngStarterMode" (48|4, standard signal, unsigned int, little endian) */ |
| 4649 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4650 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 4651 | L4_MABX_B.SFunction1_o7_ln = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4652 | |
| 4653 | /* ...... "EngDemandPercentTorque" (56|8, standard signal, unsigned int, little endian) */ |
| 4654 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4655 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4656 | L4_MABX_B.SFunction1_o8_f = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 4657 | } |
| 4658 | } |
| 4659 | } else { |
| 4660 | /* set RX status to 0 because no new message has arrived */ |
| 4661 | L4_MABX_B.SFunction1_o9_gn = 0.0; |
| 4662 | } |
| 4663 | } |
| 4664 | } |
| 4665 | |
| 4666 | /* End of Constant: '<S443>/Enable_RX_EEC1_00' */ |
| 4667 | /* End of Outputs for SubSystem: '<S571>/EEC1_001' */ |
| 4668 | |
| 4669 | /* Outputs for Enabled SubSystem: '<S575>/EEC3_001' incorporates: |
| 4670 | * EnablePort: '<S576>/Enable' |
| 4671 | */ |
| 4672 | /* Constant: '<S445>/Enable_RX_EEC3_00' */ |
| 4673 | if (L4_MABX_P.Enable_RX_EEC3_00_Value) { |
| 4674 | /* S-Function (rti_commonblock): '<S576>/S-Function1' */ |
| 4675 | /* This comment workarounds a code generation problem */ |
| 4676 | |
| 4677 | /* dSPACE RTICAN RX Message Block: "EEC3_00" Id:419356416 */ |
| 4678 | { |
| 4679 | UInt32 *CAN_Msg; |
| 4680 | static dsfloat time_old = 0.0; |
| 4681 | |
| 4682 | /* Read status and timestamp info (previous message) */ |
| 4683 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEDF00].timestamp != |
| 4684 | time_old) { |
| 4685 | /* ... save timestamp info for the calculation of the RX status |
| 4686 | during the consecutive sample hit*/ |
| 4687 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEDF00]. |
| 4688 | timestamp; |
| 4689 | |
| 4690 | /* ... set the processed flag to one */ |
| 4691 | L4_MABX_B.SFunction1_o3_fy = 1.0; |
| 4692 | L4_MABX_B.SFunction1_o4_lo = (real_T) |
| 4693 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEDF00].timestamp; |
| 4694 | L4_MABX_B.SFunction1_o5_jl = (real_T) |
| 4695 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEDF00].deltatime; |
| 4696 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEDF00].data; |
| 4697 | |
| 4698 | /* Decode CAN message */ |
| 4699 | { |
| 4700 | { |
| 4701 | rtican_Signal_t CAN_Sgn; |
| 4702 | |
| 4703 | /* ...... "SPN514_NominalFrictionPercentTorque" (0|8, standard signal, unsigned int, little endian) */ |
| 4704 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4705 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4706 | L4_MABX_B.SFunction1_o1_g = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 4707 | |
| 4708 | /* ...... "SPN2978_EstEngParasiticLossesPercentTorque" (32|8, standard signal, unsigned int, little endian) */ |
| 4709 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4710 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4711 | L4_MABX_B.SFunction1_o2_ky = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 4712 | ); |
| 4713 | } |
| 4714 | } |
| 4715 | } else { |
| 4716 | /* set RX status to 0 because no new message has arrived */ |
| 4717 | L4_MABX_B.SFunction1_o3_fy = 0.0; |
| 4718 | } |
| 4719 | } |
| 4720 | } |
| 4721 | |
| 4722 | /* End of Constant: '<S445>/Enable_RX_EEC3_00' */ |
| 4723 | /* End of Outputs for SubSystem: '<S575>/EEC3_001' */ |
| 4724 | |
| 4725 | /* DataTypeConversion: '<S575>/Data Type Conversion2' */ |
| 4726 | L4_MABX_B.SPN514_NominalFrictionPercentTo = L4_MABX_B.SFunction1_o1_g; |
| 4727 | |
| 4728 | /* DataTypeConversion: '<S575>/Data Type Conversion1' */ |
| 4729 | L4_MABX_B.SPN2978_EstEngParasiticLossesPe = L4_MABX_B.SFunction1_o2_ky; |
| 4730 | |
| 4731 | /* Outputs for Enabled SubSystem: '<S518>/CVW_0B1' incorporates: |
| 4732 | * EnablePort: '<S519>/Enable' |
| 4733 | */ |
| 4734 | /* Constant: '<S438>/Constant' */ |
| 4735 | if (L4_MABX_P.Constant_Value_gk) { |
| 4736 | /* S-Function (rti_commonblock): '<S519>/S-Function1' */ |
| 4737 | /* This comment workarounds a code generation problem */ |
| 4738 | |
| 4739 | /* dSPACE RTICAN RX Message Block: "CVW_0B" Id:419328011 */ |
| 4740 | { |
| 4741 | UInt32 *CAN_Msg; |
| 4742 | static dsfloat time_old = 0.0; |
| 4743 | |
| 4744 | /* Read status and timestamp info (previous message) */ |
| 4745 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE700B].timestamp != |
| 4746 | time_old) { |
| 4747 | /* ... save timestamp info for the calculation of the RX status |
| 4748 | during the consecutive sample hit*/ |
| 4749 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE700B]. |
| 4750 | timestamp; |
| 4751 | |
| 4752 | /* ... set the processed flag to one */ |
| 4753 | L4_MABX_B.SFunction1_o2_bq = 1.0; |
| 4754 | L4_MABX_B.SFunction1_o3_dd = (real_T) |
| 4755 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE700B].timestamp; |
| 4756 | L4_MABX_B.SFunction1_o4_ha = (real_T) |
| 4757 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE700B].deltatime; |
| 4758 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE700B].data; |
| 4759 | |
| 4760 | /* Decode CAN message */ |
| 4761 | { |
| 4762 | { |
| 4763 | rtican_Signal_t CAN_Sgn; |
| 4764 | |
| 4765 | /* ...... "SPN1760_GrossCombinationVehicleWeight" (16|16, standard signal, unsigned int, little endian) */ |
| 4766 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4767 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 4768 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4769 | L4_MABX_B.SFunction1_o1_kzx = 10 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 4770 | } |
| 4771 | } |
| 4772 | } else { |
| 4773 | /* set RX status to 0 because no new message has arrived */ |
| 4774 | L4_MABX_B.SFunction1_o2_bq = 0.0; |
| 4775 | } |
| 4776 | } |
| 4777 | } |
| 4778 | |
| 4779 | /* End of Constant: '<S438>/Constant' */ |
| 4780 | /* End of Outputs for SubSystem: '<S518>/CVW_0B1' */ |
| 4781 | |
| 4782 | /* DataTypeConversion: '<S518>/Data Type Conversion1' */ |
| 4783 | L4_MABX_B.SPN1760_GrossCombinationVehicle = L4_MABX_B.SFunction1_o1_kzx; |
| 4784 | |
| 4785 | /* Outputs for Enabled SubSystem: '<S499>/ACC1_2A_' incorporates: |
| 4786 | * EnablePort: '<S500>/Enable' |
| 4787 | */ |
| 4788 | /* Constant: '<S429>/Constant' */ |
| 4789 | if (L4_MABX_P.Constant_Value_ch) { |
| 4790 | /* S-Function (rti_commonblock): '<S500>/S-Function1' */ |
| 4791 | /* This comment workarounds a code generation problem */ |
| 4792 | |
| 4793 | /* dSPACE RTICAN RX Message Block: "ACC1_2A" Id:285110058 */ |
| 4794 | { |
| 4795 | UInt32 *CAN_Msg; |
| 4796 | static dsfloat time_old = 0.0; |
| 4797 | |
| 4798 | /* Read status and timestamp info (previous message) */ |
| 4799 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x10FE6F2A].timestamp != |
| 4800 | time_old) { |
| 4801 | /* ... save timestamp info for the calculation of the RX status |
| 4802 | during the consecutive sample hit*/ |
| 4803 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x10FE6F2A]. |
| 4804 | timestamp; |
| 4805 | |
| 4806 | /* ... set the processed flag to one */ |
| 4807 | L4_MABX_B.SFunction1_o11_mg = 1.0; |
| 4808 | L4_MABX_B.SFunction1_o12_n = (real_T) |
| 4809 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x10FE6F2A].timestamp; |
| 4810 | L4_MABX_B.SFunction1_o13_or = (real_T) |
| 4811 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x10FE6F2A].deltatime; |
| 4812 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x10FE6F2A].data; |
| 4813 | |
| 4814 | /* Decode CAN message */ |
| 4815 | { |
| 4816 | { |
| 4817 | rtican_Signal_t CAN_Sgn; |
| 4818 | |
| 4819 | /* ...... "SpeedOfForwardVehicle" (0|8, standard signal, unsigned int, little endian) */ |
| 4820 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4821 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4822 | L4_MABX_B.SFunction1_o1_de = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4823 | |
| 4824 | /* ...... "DistanceToForwardVehicle" (8|8, standard signal, unsigned int, little endian) */ |
| 4825 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 4826 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4827 | L4_MABX_B.SFunction1_o2_d5 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4828 | |
| 4829 | /* ...... "AdaptiveCruiseCtrlSetSpeed" (16|8, standard signal, unsigned int, little endian) */ |
| 4830 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4831 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4832 | L4_MABX_B.SFunction1_o3_dg = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4833 | |
| 4834 | /* ...... "AdaptiveCruiseCtrlMode" (24|3, standard signal, unsigned int, little endian) */ |
| 4835 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4836 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 4837 | L4_MABX_B.SFunction1_o4_bc = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4838 | |
| 4839 | /* ...... "AdptveCruiseCtrlSetDistanceMode" (27|3, standard signal, unsigned int, little endian) */ |
| 4840 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4841 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 3; |
| 4842 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 4843 | L4_MABX_B.SFunction1_o5_k4 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4844 | |
| 4845 | /* ...... "RoadCurvature" (32|16, standard signal, unsigned int, little endian) */ |
| 4846 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4847 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 4848 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4849 | L4_MABX_B.SFunction1_o6_j5 = -250 + ( 0.0078125 * ( ((real_T) |
| 4850 | CAN_Sgn.UnsignedSgn) ) ); |
| 4851 | |
| 4852 | /* ...... "ACCTargetDetected" (48|2, standard signal, unsigned int, little endian) */ |
| 4853 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4854 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4855 | L4_MABX_B.SFunction1_o7_hh = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4856 | |
| 4857 | /* ...... "ACCSystemShutoffWarning" (50|2, standard signal, unsigned int, little endian) */ |
| 4858 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4859 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4860 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4861 | L4_MABX_B.SFunction1_o8_oi = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4862 | |
| 4863 | /* ...... "ACCDistanceAlertSignal" (52|2, standard signal, unsigned int, little endian) */ |
| 4864 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4865 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4866 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4867 | L4_MABX_B.SFunction1_o9_ih = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4868 | |
| 4869 | /* ...... "ForwardCollisionWarning" (54|2, standard signal, unsigned int, little endian) */ |
| 4870 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4871 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4872 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4873 | L4_MABX_B.SFunction1_o10_py = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4874 | } |
| 4875 | } |
| 4876 | } else { |
| 4877 | /* set RX status to 0 because no new message has arrived */ |
| 4878 | L4_MABX_B.SFunction1_o11_mg = 0.0; |
| 4879 | } |
| 4880 | } |
| 4881 | } |
| 4882 | |
| 4883 | /* End of Constant: '<S429>/Constant' */ |
| 4884 | /* End of Outputs for SubSystem: '<S499>/ACC1_2A_' */ |
| 4885 | |
| 4886 | /* DataTypeConversion: '<S499>/Data Type Conversion12' */ |
| 4887 | L4_MABX_B.ACCDistanceAlertSignal = L4_MABX_B.SFunction1_o9_ih; |
| 4888 | |
| 4889 | /* DataTypeConversion: '<S499>/Data Type Conversion13' */ |
| 4890 | L4_MABX_B.ForwardCollisionWarning = L4_MABX_B.SFunction1_o10_py; |
| 4891 | |
| 4892 | /* RelationalOperator: '<S484>/Operator' incorporates: |
| 4893 | * Constant: '<S427>/Constant' |
| 4894 | * Constant: '<S482>/Constant' |
| 4895 | */ |
| 4896 | L4_MABX_B.Operator_nq = (L4_MABX_P.Constant_Value_by3 == |
| 4897 | L4_MABX_P.Constant_Value_jb); |
| 4898 | |
| 4899 | /* Outputs for Enabled SubSystem: '<S481>/CAN_TYPE1_RX_M1_C1' incorporates: |
| 4900 | * EnablePort: '<S483>/Enable' |
| 4901 | */ |
| 4902 | if (L4_MABX_B.Operator_nq) { |
| 4903 | /* S-Function (rti_commonblock): '<S483>/S-Function1' */ |
| 4904 | /* This comment workarounds a code generation problem */ |
| 4905 | |
| 4906 | /* dSPACE RTICAN RX Message Block: "TPCM_FF_00" Id:485293824 */ |
| 4907 | { |
| 4908 | UInt32 *CAN_Msg; |
| 4909 | static dsfloat time_old = 0.0; |
| 4910 | |
| 4911 | /* Read status and timestamp info (previous message) */ |
| 4912 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CECFF00].timestamp != |
| 4913 | time_old) { |
| 4914 | /* ... save timestamp info for the calculation of the RX status |
| 4915 | during the consecutive sample hit*/ |
| 4916 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CECFF00]. |
| 4917 | timestamp; |
| 4918 | |
| 4919 | /* ... set the processed flag to one */ |
| 4920 | L4_MABX_B.SFunction1_o9_ad = 1.0; |
| 4921 | L4_MABX_B.SFunction1_o10_n = (real_T) |
| 4922 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CECFF00].timestamp; |
| 4923 | L4_MABX_B.SFunction1_o11_p = (real_T) |
| 4924 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CECFF00].deltatime; |
| 4925 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CECFF00].data; |
| 4926 | |
| 4927 | /* Decode CAN message */ |
| 4928 | { |
| 4929 | { |
| 4930 | rtican_Signal_t CAN_Sgn; |
| 4931 | |
| 4932 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 4933 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4934 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4935 | L4_MABX_B.SFunction1_o1_bv = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4936 | |
| 4937 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 4938 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 4939 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4940 | L4_MABX_B.SFunction1_o2_kv = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4941 | |
| 4942 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 4943 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4944 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4945 | L4_MABX_B.SFunction1_o3_j2 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4946 | |
| 4947 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 4948 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4949 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4950 | L4_MABX_B.SFunction1_o4_fp = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4951 | |
| 4952 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 4953 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4954 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4955 | L4_MABX_B.SFunction1_o5_mi = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4956 | |
| 4957 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 4958 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 4959 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4960 | L4_MABX_B.SFunction1_o6_kp = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4961 | |
| 4962 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 4963 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4964 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4965 | L4_MABX_B.SFunction1_o7_gb = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4966 | |
| 4967 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 4968 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4969 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4970 | L4_MABX_B.SFunction1_o8_ez = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4971 | } |
| 4972 | } |
| 4973 | } else { |
| 4974 | /* set RX status to 0 because no new message has arrived */ |
| 4975 | L4_MABX_B.SFunction1_o9_ad = 0.0; |
| 4976 | } |
| 4977 | } |
| 4978 | } |
| 4979 | |
| 4980 | /* End of Outputs for SubSystem: '<S481>/CAN_TYPE1_RX_M1_C1' */ |
| 4981 | |
| 4982 | /* DataTypeConversion: '<S481>/Data Type Conversion' */ |
| 4983 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_bv; |
| 4984 | if (PositionFinalLimited < 256.0) { |
| 4985 | if (PositionFinalLimited >= 0.0) { |
| 4986 | starting_index = (uint8_T)PositionFinalLimited; |
| 4987 | } else { |
| 4988 | starting_index = 0U; |
| 4989 | } |
| 4990 | } else { |
| 4991 | starting_index = MAX_uint8_T; |
| 4992 | } |
| 4993 | |
| 4994 | L4_MABX_B.DataTypeConversion_ab = starting_index; |
| 4995 | |
| 4996 | /* End of DataTypeConversion: '<S481>/Data Type Conversion' */ |
| 4997 | |
| 4998 | /* DataTypeConversion: '<S481>/Data Type Conversion1' */ |
| 4999 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_kv; |
| 5000 | if (PositionFinalLimited < 256.0) { |
| 5001 | if (PositionFinalLimited >= 0.0) { |
| 5002 | starting_index = (uint8_T)PositionFinalLimited; |
| 5003 | } else { |
| 5004 | starting_index = 0U; |
| 5005 | } |
| 5006 | } else { |
| 5007 | starting_index = MAX_uint8_T; |
| 5008 | } |
| 5009 | |
| 5010 | L4_MABX_B.DataTypeConversion1_i5 = starting_index; |
| 5011 | |
| 5012 | /* End of DataTypeConversion: '<S481>/Data Type Conversion1' */ |
| 5013 | |
| 5014 | /* DataTypeConversion: '<S481>/Data Type Conversion2' */ |
| 5015 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_j2; |
| 5016 | if (PositionFinalLimited < 256.0) { |
| 5017 | if (PositionFinalLimited >= 0.0) { |
| 5018 | starting_index = (uint8_T)PositionFinalLimited; |
| 5019 | } else { |
| 5020 | starting_index = 0U; |
| 5021 | } |
| 5022 | } else { |
| 5023 | starting_index = MAX_uint8_T; |
| 5024 | } |
| 5025 | |
| 5026 | L4_MABX_B.DataTypeConversion2_ev = starting_index; |
| 5027 | |
| 5028 | /* End of DataTypeConversion: '<S481>/Data Type Conversion2' */ |
| 5029 | |
| 5030 | /* DataTypeConversion: '<S481>/Data Type Conversion3' */ |
| 5031 | PositionFinalLimited = L4_MABX_B.SFunction1_o4_fp; |
| 5032 | if (PositionFinalLimited < 256.0) { |
| 5033 | if (PositionFinalLimited >= 0.0) { |
| 5034 | starting_index = (uint8_T)PositionFinalLimited; |
| 5035 | } else { |
| 5036 | starting_index = 0U; |
| 5037 | } |
| 5038 | } else { |
| 5039 | starting_index = MAX_uint8_T; |
| 5040 | } |
| 5041 | |
| 5042 | L4_MABX_B.DataTypeConversion3_f = starting_index; |
| 5043 | |
| 5044 | /* End of DataTypeConversion: '<S481>/Data Type Conversion3' */ |
| 5045 | |
| 5046 | /* DataTypeConversion: '<S481>/Data Type Conversion4' */ |
| 5047 | PositionFinalLimited = L4_MABX_B.SFunction1_o5_mi; |
| 5048 | if (PositionFinalLimited < 256.0) { |
| 5049 | if (PositionFinalLimited >= 0.0) { |
| 5050 | starting_index = (uint8_T)PositionFinalLimited; |
| 5051 | } else { |
| 5052 | starting_index = 0U; |
| 5053 | } |
| 5054 | } else { |
| 5055 | starting_index = MAX_uint8_T; |
| 5056 | } |
| 5057 | |
| 5058 | L4_MABX_B.DataTypeConversion4_e = starting_index; |
| 5059 | |
| 5060 | /* End of DataTypeConversion: '<S481>/Data Type Conversion4' */ |
| 5061 | |
| 5062 | /* DataTypeConversion: '<S481>/Data Type Conversion5' */ |
| 5063 | PositionFinalLimited = L4_MABX_B.SFunction1_o6_kp; |
| 5064 | if (PositionFinalLimited < 256.0) { |
| 5065 | if (PositionFinalLimited >= 0.0) { |
| 5066 | starting_index = (uint8_T)PositionFinalLimited; |
| 5067 | } else { |
| 5068 | starting_index = 0U; |
| 5069 | } |
| 5070 | } else { |
| 5071 | starting_index = MAX_uint8_T; |
| 5072 | } |
| 5073 | |
| 5074 | L4_MABX_B.DataTypeConversion5_h = starting_index; |
| 5075 | |
| 5076 | /* End of DataTypeConversion: '<S481>/Data Type Conversion5' */ |
| 5077 | |
| 5078 | /* DataTypeConversion: '<S481>/Data Type Conversion6' */ |
| 5079 | PositionFinalLimited = L4_MABX_B.SFunction1_o7_gb; |
| 5080 | if (PositionFinalLimited < 256.0) { |
| 5081 | if (PositionFinalLimited >= 0.0) { |
| 5082 | starting_index = (uint8_T)PositionFinalLimited; |
| 5083 | } else { |
| 5084 | starting_index = 0U; |
| 5085 | } |
| 5086 | } else { |
| 5087 | starting_index = MAX_uint8_T; |
| 5088 | } |
| 5089 | |
| 5090 | L4_MABX_B.DataTypeConversion6_nf = starting_index; |
| 5091 | |
| 5092 | /* End of DataTypeConversion: '<S481>/Data Type Conversion6' */ |
| 5093 | |
| 5094 | /* DataTypeConversion: '<S481>/Data Type Conversion7' */ |
| 5095 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_ez; |
| 5096 | if (PositionFinalLimited < 256.0) { |
| 5097 | if (PositionFinalLimited >= 0.0) { |
| 5098 | starting_index = (uint8_T)PositionFinalLimited; |
| 5099 | } else { |
| 5100 | starting_index = 0U; |
| 5101 | } |
| 5102 | } else { |
| 5103 | starting_index = MAX_uint8_T; |
| 5104 | } |
| 5105 | |
| 5106 | L4_MABX_B.DataTypeConversion7_f = starting_index; |
| 5107 | |
| 5108 | /* End of DataTypeConversion: '<S481>/Data Type Conversion7' */ |
| 5109 | |
| 5110 | /* MultiPortSwitch: '<S427>/Multiport_Switch' */ |
| 5111 | L4_MABX_B.RawData[0] = L4_MABX_B.DataTypeConversion_ab; |
| 5112 | L4_MABX_B.RawData[1] = L4_MABX_B.DataTypeConversion1_i5; |
| 5113 | L4_MABX_B.RawData[2] = L4_MABX_B.DataTypeConversion2_ev; |
| 5114 | L4_MABX_B.RawData[3] = L4_MABX_B.DataTypeConversion3_f; |
| 5115 | L4_MABX_B.RawData[4] = L4_MABX_B.DataTypeConversion4_e; |
| 5116 | L4_MABX_B.RawData[5] = L4_MABX_B.DataTypeConversion5_h; |
| 5117 | L4_MABX_B.RawData[6] = L4_MABX_B.DataTypeConversion6_nf; |
| 5118 | L4_MABX_B.RawData[7] = L4_MABX_B.DataTypeConversion7_f; |
| 5119 | |
| 5120 | /* DataTypeConversion: '<S475>/Data Type Conversion' */ |
| 5121 | for (i = 0; i < 8; i++) { |
| 5122 | L4_MABX_B.DataTypeConversion_j2[i] = L4_MABX_B.RawData[i]; |
| 5123 | } |
| 5124 | |
| 5125 | /* End of DataTypeConversion: '<S475>/Data Type Conversion' */ |
| 5126 | |
| 5127 | /* RelationalOperator: '<S701>/Operator' incorporates: |
| 5128 | * Constant: '<S475>/Constant3' |
| 5129 | */ |
| 5130 | L4_MABX_B.Operator_b4 = (L4_MABX_B.DataTypeConversion_j2[0] == |
| 5131 | L4_MABX_P.Constant3_Value_e0); |
| 5132 | |
| 5133 | /* Outputs for Enabled SubSystem: '<S475>/Decode_TPCM_BAM' incorporates: |
| 5134 | * EnablePort: '<S693>/Enable' |
| 5135 | */ |
| 5136 | if (L4_MABX_B.Operator_b4) { |
| 5137 | /* SignalConversion: '<S704>/Signal Conversion' */ |
| 5138 | L4_MABX_B.SPN2556_ControlByte_n = L4_MABX_B.DataTypeConversion_j2[0]; |
| 5139 | |
| 5140 | /* DataTypeConversion: '<S705>/Data Type Conversion' */ |
| 5141 | L4_MABX_B.DataTypeConversion_dp = L4_MABX_B.DataTypeConversion_j2[1]; |
| 5142 | |
| 5143 | /* DataTypeConversion: '<S705>/Data Type Conversion1' */ |
| 5144 | L4_MABX_B.DataTypeConversion1_ke = L4_MABX_B.DataTypeConversion_j2[2]; |
| 5145 | |
| 5146 | /* ArithShift: '<S705>/Shift Arithmetic2' */ |
| 5147 | L4_MABX_B.ShiftArithmetic2_b = (uint16_T)(L4_MABX_B.DataTypeConversion1_ke << |
| 5148 | 8); |
| 5149 | |
| 5150 | /* S-Function (sfix_bitop): '<S708>/Operator' */ |
| 5151 | L4_MABX_B.Operator_lbu = (uint16_T)(L4_MABX_B.DataTypeConversion_dp | |
| 5152 | L4_MABX_B.ShiftArithmetic2_b); |
| 5153 | |
| 5154 | /* DataTypeConversion: '<S708>/DataType' */ |
| 5155 | L4_MABX_B.DataType_h1 = L4_MABX_B.Operator_lbu; |
| 5156 | |
| 5157 | /* SignalConversion: '<S706>/Signal Conversion' */ |
| 5158 | L4_MABX_B.SPN2568_TotalNumberOfPackets = L4_MABX_B.DataTypeConversion_j2[3]; |
| 5159 | |
| 5160 | /* DataTypeConversion: '<S707>/Data Type Conversion' */ |
| 5161 | L4_MABX_B.DataTypeConversion_e = L4_MABX_B.DataTypeConversion_j2[5]; |
| 5162 | |
| 5163 | /* DataTypeConversion: '<S707>/Data Type Conversion1' */ |
| 5164 | L4_MABX_B.DataTypeConversion1_fn = L4_MABX_B.DataTypeConversion_j2[6]; |
| 5165 | |
| 5166 | /* DataTypeConversion: '<S707>/Data Type Conversion2' */ |
| 5167 | L4_MABX_B.DataTypeConversion2_iv = L4_MABX_B.DataTypeConversion_j2[7]; |
| 5168 | |
| 5169 | /* ArithShift: '<S707>/Shift Arithmetic1' */ |
| 5170 | L4_MABX_B.ShiftArithmetic1_b = L4_MABX_B.DataTypeConversion1_fn << 8; |
| 5171 | |
| 5172 | /* ArithShift: '<S707>/Shift Arithmetic2' */ |
| 5173 | L4_MABX_B.ShiftArithmetic2_f = L4_MABX_B.DataTypeConversion2_iv << 16; |
| 5174 | |
| 5175 | /* S-Function (sfix_bitop): '<S709>/Operator' */ |
| 5176 | L4_MABX_B.Operator_j = L4_MABX_B.DataTypeConversion_e | |
| 5177 | L4_MABX_B.ShiftArithmetic1_b | L4_MABX_B.ShiftArithmetic2_f; |
| 5178 | |
| 5179 | /* DataTypeConversion: '<S709>/DataType' */ |
| 5180 | L4_MABX_B.DataType_jy = L4_MABX_B.Operator_j; |
| 5181 | } |
| 5182 | |
| 5183 | /* End of Outputs for SubSystem: '<S475>/Decode_TPCM_BAM' */ |
| 5184 | |
| 5185 | /* RelationalOperator: '<S493>/Operator' incorporates: |
| 5186 | * Constant: '<S428>/Constant' |
| 5187 | * Constant: '<S491>/Constant' |
| 5188 | */ |
| 5189 | L4_MABX_B.Operator_km = (L4_MABX_P.Constant_Value_ek == |
| 5190 | L4_MABX_P.Constant_Value_pp); |
| 5191 | |
| 5192 | /* Outputs for Enabled SubSystem: '<S490>/CAN_TYPE1_RX_M1_C1' incorporates: |
| 5193 | * EnablePort: '<S492>/Enable' |
| 5194 | */ |
| 5195 | if (L4_MABX_B.Operator_km) { |
| 5196 | /* S-Function (rti_commonblock): '<S492>/S-Function1' */ |
| 5197 | /* This comment workarounds a code generation problem */ |
| 5198 | |
| 5199 | /* dSPACE RTICAN RX Message Block: "TPDT_FF_00" Id:485228288 */ |
| 5200 | { |
| 5201 | UInt32 *CAN_Msg; |
| 5202 | static dsfloat time_old = 0.0; |
| 5203 | |
| 5204 | /* Read status and timestamp info (previous message) */ |
| 5205 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CEBFF00].timestamp != |
| 5206 | time_old) { |
| 5207 | /* ... save timestamp info for the calculation of the RX status |
| 5208 | during the consecutive sample hit*/ |
| 5209 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CEBFF00]. |
| 5210 | timestamp; |
| 5211 | |
| 5212 | /* ... set the processed flag to one */ |
| 5213 | L4_MABX_B.SFunction1_o9_dt = 1.0; |
| 5214 | L4_MABX_B.SFunction1_o10_hj = (real_T) |
| 5215 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CEBFF00].timestamp; |
| 5216 | L4_MABX_B.SFunction1_o11_h = (real_T) |
| 5217 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CEBFF00].deltatime; |
| 5218 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CEBFF00].data; |
| 5219 | |
| 5220 | /* Decode CAN message */ |
| 5221 | { |
| 5222 | { |
| 5223 | rtican_Signal_t CAN_Sgn; |
| 5224 | |
| 5225 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 5226 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 5227 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5228 | L4_MABX_B.SFunction1_o1_jh = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5229 | |
| 5230 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 5231 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 5232 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5233 | L4_MABX_B.SFunction1_o2_e2 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5234 | |
| 5235 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 5236 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 5237 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5238 | L4_MABX_B.SFunction1_o3_id = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5239 | |
| 5240 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 5241 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 5242 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5243 | L4_MABX_B.SFunction1_o4_jm = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5244 | |
| 5245 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 5246 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 5247 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5248 | L4_MABX_B.SFunction1_o5_h = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5249 | |
| 5250 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 5251 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 5252 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5253 | L4_MABX_B.SFunction1_o6_c = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5254 | |
| 5255 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 5256 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 5257 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5258 | L4_MABX_B.SFunction1_o7_dv = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5259 | |
| 5260 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 5261 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 5262 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5263 | L4_MABX_B.SFunction1_o8_of = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5264 | } |
| 5265 | } |
| 5266 | } else { |
| 5267 | /* set RX status to 0 because no new message has arrived */ |
| 5268 | L4_MABX_B.SFunction1_o9_dt = 0.0; |
| 5269 | } |
| 5270 | } |
| 5271 | } |
| 5272 | |
| 5273 | /* End of Outputs for SubSystem: '<S490>/CAN_TYPE1_RX_M1_C1' */ |
| 5274 | |
| 5275 | /* DataTypeConversion: '<S490>/Data Type Conversion' */ |
| 5276 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_jh; |
| 5277 | if (PositionFinalLimited < 256.0) { |
| 5278 | if (PositionFinalLimited >= 0.0) { |
| 5279 | starting_index = (uint8_T)PositionFinalLimited; |
| 5280 | } else { |
| 5281 | starting_index = 0U; |
| 5282 | } |
| 5283 | } else { |
| 5284 | starting_index = MAX_uint8_T; |
| 5285 | } |
| 5286 | |
| 5287 | L4_MABX_B.DataTypeConversion_by = starting_index; |
| 5288 | |
| 5289 | /* End of DataTypeConversion: '<S490>/Data Type Conversion' */ |
| 5290 | |
| 5291 | /* DataTypeConversion: '<S490>/Data Type Conversion1' */ |
| 5292 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_e2; |
| 5293 | if (PositionFinalLimited < 256.0) { |
| 5294 | if (PositionFinalLimited >= 0.0) { |
| 5295 | starting_index = (uint8_T)PositionFinalLimited; |
| 5296 | } else { |
| 5297 | starting_index = 0U; |
| 5298 | } |
| 5299 | } else { |
| 5300 | starting_index = MAX_uint8_T; |
| 5301 | } |
| 5302 | |
| 5303 | L4_MABX_B.DataTypeConversion1_ni = starting_index; |
| 5304 | |
| 5305 | /* End of DataTypeConversion: '<S490>/Data Type Conversion1' */ |
| 5306 | |
| 5307 | /* DataTypeConversion: '<S490>/Data Type Conversion2' */ |
| 5308 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_id; |
| 5309 | if (PositionFinalLimited < 256.0) { |
| 5310 | if (PositionFinalLimited >= 0.0) { |
| 5311 | starting_index = (uint8_T)PositionFinalLimited; |
| 5312 | } else { |
| 5313 | starting_index = 0U; |
| 5314 | } |
| 5315 | } else { |
| 5316 | starting_index = MAX_uint8_T; |
| 5317 | } |
| 5318 | |
| 5319 | L4_MABX_B.DataTypeConversion2_ge = starting_index; |
| 5320 | |
| 5321 | /* End of DataTypeConversion: '<S490>/Data Type Conversion2' */ |
| 5322 | |
| 5323 | /* DataTypeConversion: '<S490>/Data Type Conversion3' */ |
| 5324 | PositionFinalLimited = L4_MABX_B.SFunction1_o4_jm; |
| 5325 | if (PositionFinalLimited < 256.0) { |
| 5326 | if (PositionFinalLimited >= 0.0) { |
| 5327 | starting_index = (uint8_T)PositionFinalLimited; |
| 5328 | } else { |
| 5329 | starting_index = 0U; |
| 5330 | } |
| 5331 | } else { |
| 5332 | starting_index = MAX_uint8_T; |
| 5333 | } |
| 5334 | |
| 5335 | L4_MABX_B.DataTypeConversion3_i4 = starting_index; |
| 5336 | |
| 5337 | /* End of DataTypeConversion: '<S490>/Data Type Conversion3' */ |
| 5338 | |
| 5339 | /* DataTypeConversion: '<S490>/Data Type Conversion4' */ |
| 5340 | PositionFinalLimited = L4_MABX_B.SFunction1_o5_h; |
| 5341 | if (PositionFinalLimited < 256.0) { |
| 5342 | if (PositionFinalLimited >= 0.0) { |
| 5343 | starting_index = (uint8_T)PositionFinalLimited; |
| 5344 | } else { |
| 5345 | starting_index = 0U; |
| 5346 | } |
| 5347 | } else { |
| 5348 | starting_index = MAX_uint8_T; |
| 5349 | } |
| 5350 | |
| 5351 | L4_MABX_B.DataTypeConversion4_dm = starting_index; |
| 5352 | |
| 5353 | /* End of DataTypeConversion: '<S490>/Data Type Conversion4' */ |
| 5354 | |
| 5355 | /* DataTypeConversion: '<S490>/Data Type Conversion5' */ |
| 5356 | PositionFinalLimited = L4_MABX_B.SFunction1_o6_c; |
| 5357 | if (PositionFinalLimited < 256.0) { |
| 5358 | if (PositionFinalLimited >= 0.0) { |
| 5359 | starting_index = (uint8_T)PositionFinalLimited; |
| 5360 | } else { |
| 5361 | starting_index = 0U; |
| 5362 | } |
| 5363 | } else { |
| 5364 | starting_index = MAX_uint8_T; |
| 5365 | } |
| 5366 | |
| 5367 | L4_MABX_B.DataTypeConversion5_h3 = starting_index; |
| 5368 | |
| 5369 | /* End of DataTypeConversion: '<S490>/Data Type Conversion5' */ |
| 5370 | |
| 5371 | /* DataTypeConversion: '<S490>/Data Type Conversion6' */ |
| 5372 | PositionFinalLimited = L4_MABX_B.SFunction1_o7_dv; |
| 5373 | if (PositionFinalLimited < 256.0) { |
| 5374 | if (PositionFinalLimited >= 0.0) { |
| 5375 | starting_index = (uint8_T)PositionFinalLimited; |
| 5376 | } else { |
| 5377 | starting_index = 0U; |
| 5378 | } |
| 5379 | } else { |
| 5380 | starting_index = MAX_uint8_T; |
| 5381 | } |
| 5382 | |
| 5383 | L4_MABX_B.DataTypeConversion6_nc = starting_index; |
| 5384 | |
| 5385 | /* End of DataTypeConversion: '<S490>/Data Type Conversion6' */ |
| 5386 | |
| 5387 | /* DataTypeConversion: '<S490>/Data Type Conversion7' */ |
| 5388 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_of; |
| 5389 | if (PositionFinalLimited < 256.0) { |
| 5390 | if (PositionFinalLimited >= 0.0) { |
| 5391 | starting_index = (uint8_T)PositionFinalLimited; |
| 5392 | } else { |
| 5393 | starting_index = 0U; |
| 5394 | } |
| 5395 | } else { |
| 5396 | starting_index = MAX_uint8_T; |
| 5397 | } |
| 5398 | |
| 5399 | L4_MABX_B.DataTypeConversion7_k = starting_index; |
| 5400 | |
| 5401 | /* End of DataTypeConversion: '<S490>/Data Type Conversion7' */ |
| 5402 | |
| 5403 | /* MultiPortSwitch: '<S428>/Multiport_Switch' */ |
| 5404 | L4_MABX_B.RawData_i[0] = L4_MABX_B.DataTypeConversion_by; |
| 5405 | L4_MABX_B.RawData_i[1] = L4_MABX_B.DataTypeConversion1_ni; |
| 5406 | L4_MABX_B.RawData_i[2] = L4_MABX_B.DataTypeConversion2_ge; |
| 5407 | L4_MABX_B.RawData_i[3] = L4_MABX_B.DataTypeConversion3_i4; |
| 5408 | L4_MABX_B.RawData_i[4] = L4_MABX_B.DataTypeConversion4_dm; |
| 5409 | L4_MABX_B.RawData_i[5] = L4_MABX_B.DataTypeConversion5_h3; |
| 5410 | L4_MABX_B.RawData_i[6] = L4_MABX_B.DataTypeConversion6_nc; |
| 5411 | L4_MABX_B.RawData_i[7] = L4_MABX_B.DataTypeConversion7_k; |
| 5412 | |
| 5413 | /* DataTypeConversion: '<S476>/Data Type Conversion' */ |
| 5414 | for (i = 0; i < 8; i++) { |
| 5415 | L4_MABX_B.DataTypeConversion_f0[i] = L4_MABX_B.RawData_i[i]; |
| 5416 | } |
| 5417 | |
| 5418 | /* End of DataTypeConversion: '<S476>/Data Type Conversion' */ |
| 5419 | |
| 5420 | /* S-Function (rti_commonblock): '<S854>/S-Function1' */ |
| 5421 | |
| 5422 | /* This comment workarounds a code generation problem */ |
| 5423 | |
| 5424 | /* End of Outputs for S-Function (rti_commonblock): '<S854>/S-Function1' */ |
| 5425 | |
| 5426 | /* RateTransition: '<S423>/Rate Transition' */ |
| 5427 | switch (L4_MABX_DW.RateTransition_write_buf) { |
| 5428 | case 0: |
| 5429 | L4_MABX_DW.RateTransition_read_buf = 1; |
| 5430 | break; |
| 5431 | |
| 5432 | case 1: |
| 5433 | L4_MABX_DW.RateTransition_read_buf = 0; |
| 5434 | break; |
| 5435 | |
| 5436 | default: |
| 5437 | L4_MABX_DW.RateTransition_read_buf = L4_MABX_DW.RateTransition_last_buf_wr; |
| 5438 | break; |
| 5439 | } |
| 5440 | |
| 5441 | if (L4_MABX_DW.RateTransition_read_buf != 0) { |
| 5442 | GLB_Absolute_Timestamp = L4_MABX_DW.RateTransition_Buffer1; |
| 5443 | } else { |
| 5444 | GLB_Absolute_Timestamp = L4_MABX_DW.RateTransition_Buffer0; |
| 5445 | } |
| 5446 | |
| 5447 | L4_MABX_DW.RateTransition_read_buf = -1; |
| 5448 | |
| 5449 | /* End of RateTransition: '<S423>/Rate Transition' */ |
| 5450 | |
| 5451 | /* DataTypeConversion: '<S490>/Data Type Conversion8' */ |
| 5452 | L4_MABX_B.RX_status = (L4_MABX_B.SFunction1_o9_dt != 0.0); |
| 5453 | |
| 5454 | /* MultiPortSwitch: '<S428>/Multiport_Switch' */ |
| 5455 | L4_MABX_B.RX_status_a = L4_MABX_B.RX_status; |
| 5456 | |
| 5457 | /* RelationalOperator: '<S528>/Operator' incorporates: |
| 5458 | * Constant: '<S442>/Constant2' |
| 5459 | */ |
| 5460 | L4_MABX_B.Operator_no = (L4_MABX_B.DataType_jy == L4_MABX_P.Constant2_Value_ih); |
| 5461 | |
| 5462 | /* Logic: '<S442>/Logical Operator' */ |
| 5463 | L4_MABX_B.LogicalOperator_iz = (L4_MABX_B.RX_status_a && L4_MABX_B.Operator_no); |
| 5464 | |
| 5465 | /* Outputs for Enabled SubSystem: '<S442>/CAN_RX_EC1_00' incorporates: |
| 5466 | * EnablePort: '<S526>/Enable' |
| 5467 | */ |
| 5468 | if (L4_MABX_B.LogicalOperator_iz) { |
| 5469 | /* UnitDelay: '<S526>/Unit Delay' */ |
| 5470 | for (i = 0; i < 39; i++) { |
| 5471 | L4_MABX_B.UnitDelay_bw[i] = L4_MABX_DW.UnitDelay_DSTATE_b3[i]; |
| 5472 | } |
| 5473 | |
| 5474 | /* End of UnitDelay: '<S526>/Unit Delay' */ |
| 5475 | |
| 5476 | /* MATLAB Function: '<S526>/serialize_tpdt' */ |
| 5477 | /* MATLAB Function 'INPUTS_PIC_KW/CAN_PIC_KW/CAN_RX_EC1_00/CAN_RX_EC1_00/serialize_tpdt': '<S530>:1' */ |
| 5478 | /* '<S530>:1:9' */ |
| 5479 | if (L4_MABX_B.DataTypeConversion_f0[0] > 1) { |
| 5480 | /* '<S530>:1:6' */ |
| 5481 | /* '<S530>:1:7' */ |
| 5482 | for (i = 0; i < 39; i++) { |
| 5483 | L4_MABX_B.Data_d[i] = L4_MABX_B.UnitDelay_bw[i]; |
| 5484 | } |
| 5485 | } else { |
| 5486 | /* '<S530>:1:9' */ |
| 5487 | for (i = 0; i < 39; i++) { |
| 5488 | L4_MABX_B.Data_d[i] = MAX_uint8_T; |
| 5489 | } |
| 5490 | } |
| 5491 | |
| 5492 | /* '<S530>:1:11' */ |
| 5493 | i = (int32_T)(7U * L4_MABX_B.DataTypeConversion_f0[0]); |
| 5494 | if ((uint32_T)i > 255U) { |
| 5495 | i = 255; |
| 5496 | } |
| 5497 | |
| 5498 | tmp = i - 6U; |
| 5499 | if (tmp > (uint32_T)i) { |
| 5500 | tmp = 0U; |
| 5501 | } |
| 5502 | |
| 5503 | i = (int32_T)tmp; |
| 5504 | starting_index = (uint8_T)i; |
| 5505 | |
| 5506 | /* '<S530>:1:12' */ |
| 5507 | L4_MABX_B.Data_d[starting_index - 1] = L4_MABX_B.DataTypeConversion_f0[1]; |
| 5508 | L4_MABX_B.Data_d[starting_index] = L4_MABX_B.DataTypeConversion_f0[2]; |
| 5509 | L4_MABX_B.Data_d[starting_index + 1] = L4_MABX_B.DataTypeConversion_f0[3]; |
| 5510 | L4_MABX_B.Data_d[starting_index + 2] = L4_MABX_B.DataTypeConversion_f0[4]; |
| 5511 | L4_MABX_B.Data_d[starting_index + 3] = L4_MABX_B.DataTypeConversion_f0[5]; |
| 5512 | L4_MABX_B.Data_d[starting_index + 4] = L4_MABX_B.DataTypeConversion_f0[6]; |
| 5513 | L4_MABX_B.Data_d[starting_index + 5] = L4_MABX_B.DataTypeConversion_f0[7]; |
| 5514 | |
| 5515 | /* '<S530>:1:13' */ |
| 5516 | L4_MABX_B.RX_status_pz = (L4_MABX_B.DataTypeConversion_f0[0] == |
| 5517 | L4_MABX_B.SPN2568_TotalNumberOfPackets); |
| 5518 | |
| 5519 | /* End of MATLAB Function: '<S526>/serialize_tpdt' */ |
| 5520 | |
| 5521 | /* Outputs for Enabled SubSystem: '<S526>/Decode' incorporates: |
| 5522 | * EnablePort: '<S529>/Enable' |
| 5523 | */ |
| 5524 | if (L4_MABX_B.RX_status_pz) { |
| 5525 | /* Inport: '<S529>/Inport' */ |
| 5526 | for (i = 0; i < 39; i++) { |
| 5527 | L4_MABX_B.Inport_b[i] = L4_MABX_B.Data_d[i]; |
| 5528 | } |
| 5529 | |
| 5530 | /* End of Inport: '<S529>/Inport' */ |
| 5531 | |
| 5532 | /* Inport: '<S529>/timeStamp' */ |
| 5533 | L4_MABX_B.timeStamp_j = GLB_Absolute_Timestamp; |
| 5534 | |
| 5535 | /* UnitDelay: '<S529>/Unit_Delay' */ |
| 5536 | L4_MABX_B.Unit_Delay_i = L4_MABX_DW.Unit_Delay_DSTATE_i; |
| 5537 | |
| 5538 | /* Sum: '<S529>/Subtract' */ |
| 5539 | L4_MABX_B.Subtract_gi = (real32_T)(L4_MABX_B.timeStamp_j - |
| 5540 | L4_MABX_B.Unit_Delay_i); |
| 5541 | } |
| 5542 | |
| 5543 | /* End of Outputs for SubSystem: '<S526>/Decode' */ |
| 5544 | } |
| 5545 | |
| 5546 | /* End of Outputs for SubSystem: '<S442>/CAN_RX_EC1_00' */ |
| 5547 | |
| 5548 | /* DataTypeConversion: '<S527>/Data Type Conversion' */ |
| 5549 | for (i = 0; i < 39; i++) { |
| 5550 | L4_MABX_B.DataTypeConversion_bq[i] = L4_MABX_B.Inport_b[i]; |
| 5551 | } |
| 5552 | |
| 5553 | /* End of DataTypeConversion: '<S527>/Data Type Conversion' */ |
| 5554 | |
| 5555 | /* DataTypeConversion: '<S538>/Data Type Conversion' */ |
| 5556 | L4_MABX_B.DataTypeConversion_gs = L4_MABX_B.DataTypeConversion_bq[19]; |
| 5557 | |
| 5558 | /* DataTypeConversion: '<S538>/Data Type Conversion1' */ |
| 5559 | L4_MABX_B.DataTypeConversion1_mo = L4_MABX_B.DataTypeConversion_bq[20]; |
| 5560 | |
| 5561 | /* ArithShift: '<S538>/Shift Arithmetic' */ |
| 5562 | L4_MABX_B.ShiftArithmetic = (uint16_T)(L4_MABX_B.DataTypeConversion1_mo << 8); |
| 5563 | |
| 5564 | /* S-Function (sfix_bitop): '<S563>/Operator' */ |
| 5565 | L4_MABX_B.Operator_fd = (uint16_T)(L4_MABX_B.DataTypeConversion_gs | |
| 5566 | L4_MABX_B.ShiftArithmetic); |
| 5567 | |
| 5568 | /* DataTypeConversion: '<S563>/DataType' */ |
| 5569 | L4_MABX_B.DataType_gs = L4_MABX_B.Operator_fd; |
| 5570 | |
| 5571 | /* DataTypeConversion: '<S538>/Data Type Conversion2' */ |
| 5572 | L4_MABX_B.SPN544_EngineReferenceTorque = L4_MABX_B.DataType_gs; |
| 5573 | |
| 5574 | /* Outputs for Enabled SubSystem: '<S648>/VDC1_0B_' incorporates: |
| 5575 | * EnablePort: '<S649>/Enable' |
| 5576 | */ |
| 5577 | /* Constant: '<S462>/Constant' */ |
| 5578 | if (L4_MABX_P.Constant_Value_amj) { |
| 5579 | /* S-Function (rti_commonblock): '<S649>/S-Function1' */ |
| 5580 | /* This comment workarounds a code generation problem */ |
| 5581 | |
| 5582 | /* dSPACE RTICAN RX Message Block: "VDC1_0B" Id:419319563 */ |
| 5583 | { |
| 5584 | UInt32 *CAN_Msg; |
| 5585 | static dsfloat time_old = 0.0; |
| 5586 | |
| 5587 | /* Read status and timestamp info (previous message) */ |
| 5588 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE4F0B].timestamp != |
| 5589 | time_old) { |
| 5590 | /* ... save timestamp info for the calculation of the RX status |
| 5591 | during the consecutive sample hit*/ |
| 5592 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE4F0B]. |
| 5593 | timestamp; |
| 5594 | |
| 5595 | /* ... set the processed flag to one */ |
| 5596 | L4_MABX_B.SFunction1_o8_m = 1.0; |
| 5597 | L4_MABX_B.SFunction1_o9_m = (real_T) |
| 5598 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE4F0B].timestamp; |
| 5599 | L4_MABX_B.SFunction1_o10 = (real_T) |
| 5600 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE4F0B].deltatime; |
| 5601 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE4F0B].data; |
| 5602 | |
| 5603 | /* Decode CAN message */ |
| 5604 | { |
| 5605 | { |
| 5606 | rtican_Signal_t CAN_Sgn; |
| 5607 | |
| 5608 | /* ...... "VDCInformationSignal" (0|2, standard signal, unsigned int, little endian) */ |
| 5609 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 5610 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5611 | L4_MABX_B.SFunction1_o1_n5 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5612 | |
| 5613 | /* ...... "VDCFullyOperational" (2|2, standard signal, unsigned int, little endian) */ |
| 5614 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 5615 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 5616 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5617 | L4_MABX_B.SFunction1_o2_c5 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5618 | |
| 5619 | /* ...... "VDCBrakeLightRq" (4|2, standard signal, unsigned int, little endian) */ |
| 5620 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 5621 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 5622 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5623 | L4_MABX_B.SFunction1_o3_e2 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5624 | |
| 5625 | /* ...... "ROPEngCtrlActive" (8|2, standard signal, unsigned int, little endian) */ |
| 5626 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 5627 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5628 | L4_MABX_B.SFunction1_o4_lj = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5629 | |
| 5630 | /* ...... "ROPBrakeCtrlActive" (10|2, standard signal, unsigned int, little endian) */ |
| 5631 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 5632 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 5633 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5634 | L4_MABX_B.SFunction1_o5_i = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5635 | |
| 5636 | /* ...... "YCEngCtrlActive" (12|2, standard signal, unsigned int, little endian) */ |
| 5637 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 5638 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 5639 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5640 | L4_MABX_B.SFunction1_o6_d = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5641 | |
| 5642 | /* ...... "YCBrakeCtrlActive" (14|2, standard signal, unsigned int, little endian) */ |
| 5643 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 5644 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 5645 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5646 | L4_MABX_B.SFunction1_o7_h = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5647 | } |
| 5648 | } |
| 5649 | } else { |
| 5650 | /* set RX status to 0 because no new message has arrived */ |
| 5651 | L4_MABX_B.SFunction1_o8_m = 0.0; |
| 5652 | } |
| 5653 | } |
| 5654 | } |
| 5655 | |
| 5656 | /* End of Constant: '<S462>/Constant' */ |
| 5657 | /* End of Outputs for SubSystem: '<S648>/VDC1_0B_' */ |
| 5658 | |
| 5659 | /* Outputs for Enabled SubSystem: '<S650>/VDC2_0B1' incorporates: |
| 5660 | * EnablePort: '<S651>/Enable' |
| 5661 | */ |
| 5662 | /* Constant: '<S463>/Constant' */ |
| 5663 | if (L4_MABX_P.Constant_Value_fl) { |
| 5664 | /* S-Function (rti_commonblock): '<S651>/S-Function1' */ |
| 5665 | /* This comment workarounds a code generation problem */ |
| 5666 | |
| 5667 | /* dSPACE RTICAN RX Message Block: "VDC2_0B" Id:418384139 */ |
| 5668 | { |
| 5669 | UInt32 *CAN_Msg; |
| 5670 | static dsfloat time_old = 0.0; |
| 5671 | |
| 5672 | /* Read status and timestamp info (previous message) */ |
| 5673 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0090B].timestamp != |
| 5674 | time_old) { |
| 5675 | /* ... save timestamp info for the calculation of the RX status |
| 5676 | during the consecutive sample hit*/ |
| 5677 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0090B]. |
| 5678 | timestamp; |
| 5679 | |
| 5680 | /* ... set the processed flag to one */ |
| 5681 | L4_MABX_B.SFunction1_o7_f = 1.0; |
| 5682 | L4_MABX_B.SFunction1_o8_p = (real_T) |
| 5683 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0090B].timestamp; |
| 5684 | L4_MABX_B.SFunction1_o9 = (real_T) |
| 5685 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0090B].deltatime; |
| 5686 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0090B].data; |
| 5687 | |
| 5688 | /* Decode CAN message */ |
| 5689 | { |
| 5690 | { |
| 5691 | rtican_Signal_t CAN_Sgn; |
| 5692 | |
| 5693 | /* ...... "SteerWheelAngle" (0|16, standard signal, unsigned int, little endian) */ |
| 5694 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 5695 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 5696 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 5697 | SteerWheelAngle = -31.374 + ( 0.0009765625 * ( ((real_T) |
| 5698 | CAN_Sgn.UnsignedSgn) ) ); |
| 5699 | |
| 5700 | /* ...... "SteerWheelTurnCounter" (16|6, standard signal, unsigned int, little endian) */ |
| 5701 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 5702 | CAN_Sgn.UnsignedSgn &= 0x0000003F; |
| 5703 | L4_MABX_B.SFunction1_o2_gn = -32 + ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 5704 | |
| 5705 | /* ...... "SteerWheelAngleSensorType" (22|2, standard signal, unsigned int, little endian) */ |
| 5706 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 5707 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 5708 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5709 | L4_MABX_B.SFunction1_o3_jk = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5710 | |
| 5711 | /* ...... "YawRate" (24|16, standard signal, unsigned int, little endian) */ |
| 5712 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 5713 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 5714 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 5715 | YawRate = -3.92 + ( 0.0001220703125 * ( ((real_T) |
| 5716 | CAN_Sgn.UnsignedSgn) ) ); |
| 5717 | |
| 5718 | /* ...... "LateralAcceleration" (40|16, standard signal, unsigned int, little endian) */ |
| 5719 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 5720 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 5721 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 5722 | L4_MABX_B.SFunction1_o5_f = -15.687 + ( 0.00048828125 * ( ((real_T) |
| 5723 | CAN_Sgn.UnsignedSgn) ) ); |
| 5724 | |
| 5725 | /* ...... "LongitudinalAcceleration" (56|8, standard signal, unsigned int, little endian) */ |
| 5726 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 5727 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5728 | SPN1810_LongitudinalAcceleration = -12.5 + ( 0.1 * ( ((real_T) |
| 5729 | CAN_Sgn.UnsignedSgn) ) ); |
| 5730 | } |
| 5731 | } |
| 5732 | } else { |
| 5733 | /* set RX status to 0 because no new message has arrived */ |
| 5734 | L4_MABX_B.SFunction1_o7_f = 0.0; |
| 5735 | } |
| 5736 | } |
| 5737 | } |
| 5738 | |
| 5739 | /* End of Constant: '<S463>/Constant' */ |
| 5740 | /* End of Outputs for SubSystem: '<S650>/VDC2_0B1' */ |
| 5741 | |
| 5742 | /* UnitDelay: '<S655>/Unit_Delay3' */ |
| 5743 | L4_MABX_B.Unit_Delay3 = L4_MABX_DW.Unit_Delay3_DSTATE; |
| 5744 | |
| 5745 | /* RelationalOperator: '<S656>/Operator' incorporates: |
| 5746 | * Constant: '<S465>/Constant2' |
| 5747 | */ |
| 5748 | L4_MABX_B.Operator_h3 = (L4_MABX_B.DataType_jy == L4_MABX_P.Constant2_Value_ok); |
| 5749 | |
| 5750 | /* Logic: '<S465>/Logical Operator' */ |
| 5751 | L4_MABX_B.LogicalOperator_im = (L4_MABX_B.RX_status_a && L4_MABX_B.Operator_h3); |
| 5752 | |
| 5753 | /* Outputs for Enabled SubSystem: '<S465>/CAN_RX_VI_00' incorporates: |
| 5754 | * EnablePort: '<S654>/Enable' |
| 5755 | */ |
| 5756 | if (L4_MABX_B.LogicalOperator_im) { |
| 5757 | /* UnitDelay: '<S654>/Unit Delay' */ |
| 5758 | for (i = 0; i < 17; i++) { |
| 5759 | L4_MABX_B.UnitDelay_h[i] = L4_MABX_DW.UnitDelay_DSTATE_o[i]; |
| 5760 | } |
| 5761 | |
| 5762 | /* End of UnitDelay: '<S654>/Unit Delay' */ |
| 5763 | |
| 5764 | /* MATLAB Function: '<S654>/serialize_tpdt' */ |
| 5765 | /* MATLAB Function 'INPUTS_PIC_KW/CAN_PIC_KW/CAN_RX_VI_00/CAN_RX_VI_00/serialize_tpdt': '<S658>:1' */ |
| 5766 | /* '<S658>:1:9' */ |
| 5767 | if (L4_MABX_B.DataTypeConversion_f0[0] > 1) { |
| 5768 | /* '<S658>:1:6' */ |
| 5769 | /* '<S658>:1:7' */ |
| 5770 | for (i = 0; i < 17; i++) { |
| 5771 | L4_MABX_B.Data[i] = L4_MABX_B.UnitDelay_h[i]; |
| 5772 | } |
| 5773 | } else { |
| 5774 | /* '<S658>:1:9' */ |
| 5775 | for (i = 0; i < 17; i++) { |
| 5776 | L4_MABX_B.Data[i] = MAX_uint8_T; |
| 5777 | } |
| 5778 | } |
| 5779 | |
| 5780 | /* '<S658>:1:11' */ |
| 5781 | i = (int32_T)(7U * L4_MABX_B.DataTypeConversion_f0[0]); |
| 5782 | if ((uint32_T)i > 255U) { |
| 5783 | i = 255; |
| 5784 | } |
| 5785 | |
| 5786 | tmp = i - 6U; |
| 5787 | if (tmp > (uint32_T)i) { |
| 5788 | tmp = 0U; |
| 5789 | } |
| 5790 | |
| 5791 | i = (int32_T)tmp; |
| 5792 | starting_index = (uint8_T)i; |
| 5793 | |
| 5794 | /* '<S658>:1:12' */ |
| 5795 | L4_MABX_B.Data[starting_index - 1] = L4_MABX_B.DataTypeConversion_f0[1]; |
| 5796 | L4_MABX_B.Data[starting_index] = L4_MABX_B.DataTypeConversion_f0[2]; |
| 5797 | L4_MABX_B.Data[starting_index + 1] = L4_MABX_B.DataTypeConversion_f0[3]; |
| 5798 | L4_MABX_B.Data[starting_index + 2] = L4_MABX_B.DataTypeConversion_f0[4]; |
| 5799 | L4_MABX_B.Data[starting_index + 3] = L4_MABX_B.DataTypeConversion_f0[5]; |
| 5800 | L4_MABX_B.Data[starting_index + 4] = L4_MABX_B.DataTypeConversion_f0[6]; |
| 5801 | L4_MABX_B.Data[starting_index + 5] = L4_MABX_B.DataTypeConversion_f0[7]; |
| 5802 | |
| 5803 | /* '<S658>:1:13' */ |
| 5804 | L4_MABX_B.RX_status_bk = (L4_MABX_B.DataTypeConversion_f0[0] == |
| 5805 | L4_MABX_B.SPN2568_TotalNumberOfPackets); |
| 5806 | |
| 5807 | /* End of MATLAB Function: '<S654>/serialize_tpdt' */ |
| 5808 | |
| 5809 | /* Outputs for Enabled SubSystem: '<S654>/Decode' incorporates: |
| 5810 | * EnablePort: '<S657>/Enable' |
| 5811 | */ |
| 5812 | if (L4_MABX_B.RX_status_bk) { |
| 5813 | /* Inport: '<S657>/Inport' */ |
| 5814 | for (i = 0; i < 17; i++) { |
| 5815 | L4_MABX_B.Inport[i] = L4_MABX_B.Data[i]; |
| 5816 | } |
| 5817 | |
| 5818 | /* End of Inport: '<S657>/Inport' */ |
| 5819 | |
| 5820 | /* Inport: '<S657>/timeStamp' */ |
| 5821 | L4_MABX_B.timeStamp = GLB_Absolute_Timestamp; |
| 5822 | |
| 5823 | /* UnitDelay: '<S657>/Unit_Delay' */ |
| 5824 | L4_MABX_B.Unit_Delay_m = L4_MABX_DW.Unit_Delay_DSTATE_d; |
| 5825 | |
| 5826 | /* Sum: '<S657>/Subtract' */ |
| 5827 | L4_MABX_B.Subtract_j3 = (real32_T)(L4_MABX_B.timeStamp - |
| 5828 | L4_MABX_B.Unit_Delay_m); |
| 5829 | } |
| 5830 | |
| 5831 | /* End of Outputs for SubSystem: '<S654>/Decode' */ |
| 5832 | } |
| 5833 | |
| 5834 | /* End of Outputs for SubSystem: '<S465>/CAN_RX_VI_00' */ |
| 5835 | |
| 5836 | /* DataTypeConversion: '<S655>/Data Type Conversion' */ |
| 5837 | L4_MABX_B.DataTypeConversion_jo = L4_MABX_B.Inport[0]; |
| 5838 | |
| 5839 | /* DataTypeConversion: '<S655>/Data Type Conversion1' */ |
| 5840 | L4_MABX_B.DataTypeConversion1_aq = L4_MABX_B.Inport[1]; |
| 5841 | |
| 5842 | /* DataTypeConversion: '<S655>/Data Type Conversion2' */ |
| 5843 | L4_MABX_B.DataTypeConversion2_gd = L4_MABX_B.Inport[2]; |
| 5844 | |
| 5845 | /* DataTypeConversion: '<S655>/Data Type Conversion3' */ |
| 5846 | L4_MABX_B.DataTypeConversion3_g = L4_MABX_B.Inport[3]; |
| 5847 | |
| 5848 | /* DataTypeConversion: '<S655>/Data Type Conversion4' */ |
| 5849 | L4_MABX_B.DataTypeConversion4_g4 = L4_MABX_B.Inport[4]; |
| 5850 | |
| 5851 | /* DataTypeConversion: '<S655>/Data Type Conversion5' */ |
| 5852 | L4_MABX_B.DataTypeConversion5_gv = L4_MABX_B.Inport[5]; |
| 5853 | |
| 5854 | /* DataTypeConversion: '<S655>/Data Type Conversion6' */ |
| 5855 | L4_MABX_B.DataTypeConversion6_e = L4_MABX_B.Inport[6]; |
| 5856 | |
| 5857 | /* DataTypeConversion: '<S655>/Data Type Conversion7' */ |
| 5858 | L4_MABX_B.DataTypeConversion7_m = L4_MABX_B.Inport[7]; |
| 5859 | |
| 5860 | /* DataTypeConversion: '<S655>/Data Type Conversion8' */ |
| 5861 | L4_MABX_B.DataTypeConversion8_aj = L4_MABX_B.Inport[8]; |
| 5862 | |
| 5863 | /* DataTypeConversion: '<S655>/Data Type Conversion9' */ |
| 5864 | L4_MABX_B.DataTypeConversion9_o = L4_MABX_B.Inport[9]; |
| 5865 | |
| 5866 | /* DataTypeConversion: '<S655>/Data Type Conversion10' */ |
| 5867 | L4_MABX_B.DataTypeConversion10_f5 = L4_MABX_B.Inport[10]; |
| 5868 | |
| 5869 | /* DataTypeConversion: '<S655>/Data Type Conversion11' */ |
| 5870 | L4_MABX_B.DataTypeConversion11_a = L4_MABX_B.Inport[11]; |
| 5871 | |
| 5872 | /* DataTypeConversion: '<S655>/Data Type Conversion12' */ |
| 5873 | L4_MABX_B.DataTypeConversion12 = L4_MABX_B.Inport[12]; |
| 5874 | |
| 5875 | /* DataTypeConversion: '<S655>/Data Type Conversion14' */ |
| 5876 | L4_MABX_B.DataTypeConversion14_k = L4_MABX_B.Inport[13]; |
| 5877 | |
| 5878 | /* DataTypeConversion: '<S655>/Data Type Conversion13' */ |
| 5879 | L4_MABX_B.DataTypeConversion13_h = L4_MABX_B.Inport[14]; |
| 5880 | |
| 5881 | /* DataTypeConversion: '<S655>/Data Type Conversion15' */ |
| 5882 | L4_MABX_B.DataTypeConversion15_o = L4_MABX_B.Inport[15]; |
| 5883 | |
| 5884 | /* DataTypeConversion: '<S655>/Data Type Conversion16' */ |
| 5885 | L4_MABX_B.DataTypeConversion16_o = L4_MABX_B.Inport[16]; |
| 5886 | |
| 5887 | /* RelationalOperator: '<S655>/Relational Operator1' incorporates: |
| 5888 | * Constant: '<S655>/TRUCK_1571_VIN_CPV' |
| 5889 | */ |
| 5890 | L4_MABX_B.RelationalOperator1_d[0] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[0] != |
| 5891 | L4_MABX_B.DataTypeConversion_jo); |
| 5892 | L4_MABX_B.RelationalOperator1_d[1] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[1] != |
| 5893 | L4_MABX_B.DataTypeConversion1_aq); |
| 5894 | L4_MABX_B.RelationalOperator1_d[2] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[2] != |
| 5895 | L4_MABX_B.DataTypeConversion2_gd); |
| 5896 | L4_MABX_B.RelationalOperator1_d[3] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[3] != |
| 5897 | L4_MABX_B.DataTypeConversion3_g); |
| 5898 | L4_MABX_B.RelationalOperator1_d[4] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[4] != |
| 5899 | L4_MABX_B.DataTypeConversion4_g4); |
| 5900 | L4_MABX_B.RelationalOperator1_d[5] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[5] != |
| 5901 | L4_MABX_B.DataTypeConversion5_gv); |
| 5902 | L4_MABX_B.RelationalOperator1_d[6] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[6] != |
| 5903 | L4_MABX_B.DataTypeConversion6_e); |
| 5904 | L4_MABX_B.RelationalOperator1_d[7] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[7] != |
| 5905 | L4_MABX_B.DataTypeConversion7_m); |
| 5906 | L4_MABX_B.RelationalOperator1_d[8] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[8] != |
| 5907 | L4_MABX_B.DataTypeConversion8_aj); |
| 5908 | L4_MABX_B.RelationalOperator1_d[9] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[9] != |
| 5909 | L4_MABX_B.DataTypeConversion9_o); |
| 5910 | L4_MABX_B.RelationalOperator1_d[10] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[10] |
| 5911 | != L4_MABX_B.DataTypeConversion10_f5); |
| 5912 | L4_MABX_B.RelationalOperator1_d[11] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[11] |
| 5913 | != L4_MABX_B.DataTypeConversion11_a); |
| 5914 | L4_MABX_B.RelationalOperator1_d[12] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[12] |
| 5915 | != L4_MABX_B.DataTypeConversion12); |
| 5916 | L4_MABX_B.RelationalOperator1_d[13] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[13] |
| 5917 | != L4_MABX_B.DataTypeConversion14_k); |
| 5918 | L4_MABX_B.RelationalOperator1_d[14] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[14] |
| 5919 | != L4_MABX_B.DataTypeConversion13_h); |
| 5920 | L4_MABX_B.RelationalOperator1_d[15] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[15] |
| 5921 | != L4_MABX_B.DataTypeConversion15_o); |
| 5922 | L4_MABX_B.RelationalOperator1_d[16] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[16] |
| 5923 | != L4_MABX_B.DataTypeConversion16_o); |
| 5924 | |
| 5925 | /* Sum: '<S655>/Add' */ |
| 5926 | tmp = 0U; |
| 5927 | for (i = 0; i < 17; i++) { |
| 5928 | tmp += L4_MABX_B.RelationalOperator1_d[i]; |
| 5929 | } |
| 5930 | |
| 5931 | L4_MABX_B.Add_au = (uint8_T)tmp; |
| 5932 | |
| 5933 | /* End of Sum: '<S655>/Add' */ |
| 5934 | |
| 5935 | /* RelationalOperator: '<S659>/Compare' incorporates: |
| 5936 | * Constant: '<S659>/Constant' |
| 5937 | */ |
| 5938 | L4_MABX_B.Compare_i = (L4_MABX_B.Add_au == L4_MABX_P.Constant_Value_p04); |
| 5939 | |
| 5940 | /* Logic: '<S655>/Logical Operator' */ |
| 5941 | L4_MABX_B.LogicalOperator_o = (L4_MABX_B.Unit_Delay3 && L4_MABX_B.Compare_i); |
| 5942 | |
| 5943 | /* UnitDelay: '<S655>/Unit_Delay' */ |
| 5944 | L4_MABX_B.Unit_Delay_mm = L4_MABX_DW.Unit_Delay_DSTATE_h1; |
| 5945 | |
| 5946 | /* Logic: '<S661>/Logical Operator3' */ |
| 5947 | L4_MABX_B.LogicalOperator3_l = !L4_MABX_B.Unit_Delay_mm; |
| 5948 | |
| 5949 | /* UnitDelay: '<S661>/Unit_Delay' */ |
| 5950 | L4_MABX_B.Unit_Delay_iz = L4_MABX_DW.Unit_Delay_DSTATE_fr; |
| 5951 | |
| 5952 | /* Logic: '<S661>/Logical Operator' */ |
| 5953 | L4_MABX_B.LogicalOperator_b = (L4_MABX_B.LogicalOperator3_l && |
| 5954 | L4_MABX_B.Unit_Delay_iz); |
| 5955 | |
| 5956 | /* Logic: '<S661>/Logical Operator1' */ |
| 5957 | L4_MABX_B.LogicalOperator1_c = (L4_MABX_B.LogicalOperator_o || |
| 5958 | L4_MABX_B.LogicalOperator_b); |
| 5959 | |
| 5960 | /* Outputs for Enabled SubSystem: '<S636>/SSI2_031' incorporates: |
| 5961 | * EnablePort: '<S637>/Enable' |
| 5962 | */ |
| 5963 | /* Constant: '<S456>/Constant' */ |
| 5964 | if (L4_MABX_P.Constant_Value_ov > 0.0) { |
| 5965 | /* S-Function (rti_commonblock): '<S637>/S-Function1' */ |
| 5966 | /* This comment workarounds a code generation problem */ |
| 5967 | |
| 5968 | /* dSPACE RTICAN RX Message Block: "SSI2_03" Id:217065731 */ |
| 5969 | { |
| 5970 | UInt32 *CAN_Msg; |
| 5971 | static dsfloat time_old = 0.0; |
| 5972 | |
| 5973 | /* Read status and timestamp info (previous message) */ |
| 5974 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02903].timestamp != |
| 5975 | time_old) { |
| 5976 | /* ... save timestamp info for the calculation of the RX status |
| 5977 | during the consecutive sample hit*/ |
| 5978 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02903]. |
| 5979 | timestamp; |
| 5980 | |
| 5981 | /* ... set the processed flag to one */ |
| 5982 | L4_MABX_B.SFunction1_o8_h = 1.0; |
| 5983 | L4_MABX_B.SFunction1_o9_i = (real_T) |
| 5984 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02903].timestamp; |
| 5985 | L4_MABX_B.SFunction1_o10_ha = (real_T) |
| 5986 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02903].deltatime; |
| 5987 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02903].data; |
| 5988 | |
| 5989 | /* Decode CAN message */ |
| 5990 | { |
| 5991 | { |
| 5992 | rtican_Signal_t CAN_Sgn; |
| 5993 | |
| 5994 | /* ...... "PitchAngleExRange" (0|24, standard signal, unsigned int, little endian) */ |
| 5995 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 5996 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 5997 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[2]; |
| 5998 | CAN_Sgn.UnsignedSgn &= 0x00FFFFFF; |
| 5999 | L4_MABX_B.SFunction1_o1_fk = -250 + ( 3.0517578125E-5 * ( ((real_T) |
| 6000 | CAN_Sgn.UnsignedSgn) ) ); |
| 6001 | |
| 6002 | /* ...... "RollAngleExRange" (24|24, standard signal, unsigned int, little endian) */ |
| 6003 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 6004 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 6005 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[5]; |
| 6006 | CAN_Sgn.UnsignedSgn &= 0x00FFFFFF; |
| 6007 | L4_MABX_B.SFunction1_o2_pq = -250 + ( 3.0517578125E-5 * ( ((real_T) |
| 6008 | CAN_Sgn.UnsignedSgn) ) ); |
| 6009 | |
| 6010 | /* ...... "PitchAngleExRangeCompensation" (48|2, standard signal, unsigned int, little endian) */ |
| 6011 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 6012 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 6013 | L4_MABX_B.SFunction1_o3_eq = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6014 | |
| 6015 | /* ...... "PitchAngleExRangeFigureOfMerit" (50|2, standard signal, unsigned int, little endian) */ |
| 6016 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 6017 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 6018 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 6019 | L4_MABX_B.SFunction1_o4_be = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6020 | |
| 6021 | /* ...... "RollAngleExRangeCompensation" (52|2, standard signal, unsigned int, little endian) */ |
| 6022 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 6023 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 6024 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 6025 | L4_MABX_B.SFunction1_o5_fy = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6026 | |
| 6027 | /* ...... "RollAngleExRangeFigureOfMerit" (54|2, standard signal, unsigned int, little endian) */ |
| 6028 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 6029 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 6030 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 6031 | L4_MABX_B.SFunction1_o6_l = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6032 | |
| 6033 | /* ...... "RllAndPtchExRngMsurementLatency" (56|8, standard signal, unsigned int, little endian) */ |
| 6034 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 6035 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 6036 | L4_MABX_B.SFunction1_o7_p = 0.5 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 6037 | } |
| 6038 | } |
| 6039 | } else { |
| 6040 | /* set RX status to 0 because no new message has arrived */ |
| 6041 | L4_MABX_B.SFunction1_o8_h = 0.0; |
| 6042 | } |
| 6043 | } |
| 6044 | } |
| 6045 | |
| 6046 | /* End of Constant: '<S456>/Constant' */ |
| 6047 | /* End of Outputs for SubSystem: '<S636>/SSI2_031' */ |
| 6048 | |
| 6049 | /* DataTypeConversion: '<S636>/Data Type Conversion1' */ |
| 6050 | L4_MABX_B.PitchAngleExRange = L4_MABX_B.SFunction1_o1_fk; |
| 6051 | |
| 6052 | /* Outputs for Enabled SubSystem: '<S627>/PX2_LanePosEst' incorporates: |
| 6053 | * EnablePort: '<S630>/Enable' |
| 6054 | */ |
| 6055 | /* Constant: '<S453>/Constant' */ |
| 6056 | if (L4_MABX_P.Constant_Value_kr) { |
| 6057 | /* S-Function (rti_commonblock): '<S630>/S-Function1' */ |
| 6058 | /* This comment workarounds a code generation problem */ |
| 6059 | |
| 6060 | /* dSPACE RTICAN RX Message Block: "PX2_LanePosEst" Id:769 */ |
| 6061 | { |
| 6062 | UInt32 *CAN_Msg; |
| 6063 | static dsfloat time_old = 0.0; |
| 6064 | |
| 6065 | /* Read status and timestamp info (previous message) */ |
| 6066 | if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x301].timestamp != |
| 6067 | time_old) { |
| 6068 | /* ... save timestamp info for the calculation of the RX status |
| 6069 | during the consecutive sample hit*/ |
| 6070 | time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x301].timestamp; |
| 6071 | |
| 6072 | /* ... set the processed flag to one */ |
| 6073 | L4_MABX_B.SFunction1_o5_b = 1.0; |
| 6074 | L4_MABX_B.SFunction1_o6_kc = (real_T) |
| 6075 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x301].timestamp; |
| 6076 | L4_MABX_B.SFunction1_o7_d = (real_T) |
| 6077 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x301].deltatime; |
| 6078 | CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x301].data; |
| 6079 | |
| 6080 | /* Decode CAN message */ |
| 6081 | { |
| 6082 | { |
| 6083 | rtican_Signal_t CAN_Sgn; |
| 6084 | |
| 6085 | /* ...... "PX2_LanePosEstAngle" (0|16, standard signal, signed int, little endian) */ |
| 6086 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 6087 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 6088 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 6089 | if (CAN_Sgn.SignedSgn >> 15) { |
| 6090 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 6091 | } |
| 6092 | |
| 6093 | L4_MABX_B.SFunction1_o1_oq = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 6094 | |
| 6095 | /* ...... "PX2_LanePosEstNumPoints" (16|8, standard signal, unsigned int, little endian) */ |
| 6096 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 6097 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 6098 | L4_MABX_B.SFunction1_o2_mr = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6099 | |
| 6100 | /* ...... "PX2_LanePosEstPosition" (24|16, standard signal, signed int, little endian) */ |
| 6101 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 6102 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 6103 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 6104 | if (CAN_Sgn.SignedSgn >> 15) { |
| 6105 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 6106 | } |
| 6107 | |
| 6108 | L4_MABX_B.SFunction1_o3_ev = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 6109 | |
| 6110 | /* ...... "PX2_LanePosEstNumLanes" (40|4, standard signal, unsigned int, little endian) */ |
| 6111 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 6112 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 6113 | L4_MABX_B.SFunction1_o4_aw = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6114 | } |
| 6115 | } |
| 6116 | } else { |
| 6117 | /* set RX status to 0 because no new message has arrived */ |
| 6118 | L4_MABX_B.SFunction1_o5_b = 0.0; |
| 6119 | } |
| 6120 | } |
| 6121 | } |
| 6122 | |
| 6123 | /* End of Outputs for SubSystem: '<S627>/PX2_LanePosEst' */ |
| 6124 | |
| 6125 | /* Outputs for Enabled SubSystem: '<S634>/Bendix_Prop2C2_Status_30' incorporates: |
| 6126 | * EnablePort: '<S635>/Enable' |
| 6127 | */ |
| 6128 | /* Constant: '<S455>/Constant' */ |
| 6129 | if (L4_MABX_P.Constant_Value_i3 > 0.0) { |
| 6130 | /* S-Function (rti_commonblock): '<S635>/S-Function1' */ |
| 6131 | /* This comment workarounds a code generation problem */ |
| 6132 | |
| 6133 | /* dSPACE RTICAN RX Message Block: "Prop2C2_Status_30" Id:419382064 */ |
| 6134 | { |
| 6135 | UInt32 *CAN_Msg; |
| 6136 | static dsfloat time_old = 0.0; |
| 6137 | |
| 6138 | /* Read status and timestamp info (previous message) */ |
| 6139 | if (can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF4330].timestamp != |
| 6140 | time_old) { |
| 6141 | /* ... save timestamp info for the calculation of the RX status |
| 6142 | during the consecutive sample hit*/ |
| 6143 | time_old = can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF4330]. |
| 6144 | timestamp; |
| 6145 | |
| 6146 | /* ... set the processed flag to one */ |
| 6147 | L4_MABX_B.SFunction1_o11_d = 1.0; |
| 6148 | L4_MABX_B.SFunction1_o12_k = (real_T) |
| 6149 | can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF4330].timestamp; |
| 6150 | L4_MABX_B.SFunction1_o13_g = (real_T) |
| 6151 | can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF4330].deltatime; |
| 6152 | CAN_Msg = can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF4330].data; |
| 6153 | |
| 6154 | /* Decode CAN message */ |
| 6155 | { |
| 6156 | { |
| 6157 | rtican_Signal_t CAN_Sgn; |
| 6158 | |
| 6159 | /* ...... "PressureP4" (0|8, standard signal, unsigned int, little endian) */ |
| 6160 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 6161 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 6162 | L4_MABX_B.SFunction1_o1_ko = 80 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 6163 | |
| 6164 | /* ...... "PressureP1" (8|8, standard signal, unsigned int, little endian) */ |
| 6165 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 6166 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 6167 | L4_MABX_B.SFunction1_o2_jn = 80 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 6168 | |
| 6169 | /* ...... "PressureP21" (16|8, standard signal, unsigned int, little endian) */ |
| 6170 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 6171 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 6172 | L4_MABX_B.SFunction1_o3_hm = 80 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 6173 | |
| 6174 | /* ...... "PressureP22" (24|8, standard signal, unsigned int, little endian) */ |
| 6175 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 6176 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 6177 | L4_MABX_B.SFunction1_o4_hk = 80 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 6178 | |
| 6179 | /* ...... "PressureP42" (32|8, standard signal, unsigned int, little endian) */ |
| 6180 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 6181 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 6182 | L4_MABX_B.SFunction1_o5_fg = 80 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 6183 | |
| 6184 | /* ...... "XPR1ControlStatus" (40|4, standard signal, unsigned int, little endian) */ |
| 6185 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 6186 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 6187 | L4_MABX_B.SFunction1_o6_a = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6188 | |
| 6189 | /* ...... "XPR2ControlStatus" (44|4, standard signal, unsigned int, little endian) */ |
| 6190 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 6191 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 6192 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 6193 | L4_MABX_B.SFunction1_o7_a = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6194 | |
| 6195 | /* ...... "XPR3ControlStatus" (48|4, standard signal, unsigned int, little endian) */ |
| 6196 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 6197 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 6198 | L4_MABX_B.SFunction1_o8_b = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6199 | |
| 6200 | /* ...... "XPRErrorState" (56|2, standard signal, unsigned int, little endian) */ |
| 6201 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 6202 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 6203 | L4_MABX_B.SFunction1_o9_l = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6204 | |
| 6205 | /* ...... "XPRControlMode" (58|4, standard signal, unsigned int, little endian) */ |
| 6206 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 6207 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 6208 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 6209 | L4_MABX_B.SFunction1_o10_d = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6210 | } |
| 6211 | } |
| 6212 | } else { |
| 6213 | /* set RX status to 0 because no new message has arrived */ |
| 6214 | L4_MABX_B.SFunction1_o11_d = 0.0; |
| 6215 | } |
| 6216 | } |
| 6217 | } |
| 6218 | |
| 6219 | /* End of Constant: '<S455>/Constant' */ |
| 6220 | /* End of Outputs for SubSystem: '<S634>/Bendix_Prop2C2_Status_30' */ |
| 6221 | |
| 6222 | /* DataTypeConversion: '<S634>/Data Type Conversion15' */ |
| 6223 | PositionFinalLimited = L4_MABX_B.SFunction1_o10_d; |
| 6224 | if (PositionFinalLimited < 256.0) { |
| 6225 | if (PositionFinalLimited >= 0.0) { |
| 6226 | starting_index = (uint8_T)PositionFinalLimited; |
| 6227 | } else { |
| 6228 | starting_index = 0U; |
| 6229 | } |
| 6230 | } else { |
| 6231 | starting_index = MAX_uint8_T; |
| 6232 | } |
| 6233 | |
| 6234 | L4_MABX_B.DataTypeConversion15_m = starting_index; |
| 6235 | |
| 6236 | /* End of DataTypeConversion: '<S634>/Data Type Conversion15' */ |
| 6237 | |
| 6238 | /* DataTypeConversion: '<S634>/Data Type Conversion5' */ |
| 6239 | L4_MABX_B.XPRControlMode = (ENUM_XPR_CONTROL_MODE_T) |
| 6240 | safe_cast_to_ENUM_XPR_CONTROL_M(L4_MABX_B.DataTypeConversion15_m); |
| 6241 | |
| 6242 | /* DataTypeConversion: '<S634>/Data Type Conversion4' */ |
| 6243 | PositionFinalLimited = L4_MABX_B.SFunction1_o9_l; |
| 6244 | if (PositionFinalLimited < 256.0) { |
| 6245 | if (PositionFinalLimited >= 0.0) { |
| 6246 | starting_index = (uint8_T)PositionFinalLimited; |
| 6247 | } else { |
| 6248 | starting_index = 0U; |
| 6249 | } |
| 6250 | } else { |
| 6251 | starting_index = MAX_uint8_T; |
| 6252 | } |
| 6253 | |
| 6254 | L4_MABX_B.DataTypeConversion4_lm = starting_index; |
| 6255 | |
| 6256 | /* End of DataTypeConversion: '<S634>/Data Type Conversion4' */ |
| 6257 | |
| 6258 | /* DataTypeConversion: '<S634>/Data Type Conversion14' */ |
| 6259 | L4_MABX_B.XPRErrorState = (ENUM_XPR_ERROR_STATE_T) |
| 6260 | safe_cast_to_ENUM_XPR_ERROR_STA(L4_MABX_B.DataTypeConversion4_lm); |
| 6261 | |
| 6262 | /* DataTypeConversion: '<S634>/Data Type Conversion7' */ |
| 6263 | L4_MABX_B.PressureP1 = L4_MABX_B.SFunction1_o2_jn; |
| 6264 | |
| 6265 | /* DataTypeConversion: '<S634>/Data Type Conversion6' */ |
| 6266 | L4_MABX_B.PressureP4 = L4_MABX_B.SFunction1_o1_ko; |
| 6267 | |
| 6268 | /* DataTypeConversion: '<S634>/Data Type Conversion11' */ |
| 6269 | L4_MABX_B.PressureP21 = L4_MABX_B.SFunction1_o3_hm; |
| 6270 | |
| 6271 | /* DataTypeConversion: '<S634>/Data Type Conversion12' */ |
| 6272 | L4_MABX_B.PressureP22 = L4_MABX_B.SFunction1_o4_hk; |
| 6273 | |
| 6274 | /* DataTypeConversion: '<S634>/Data Type Conversion13' */ |
| 6275 | L4_MABX_B.PressureP42 = L4_MABX_B.SFunction1_o5_fg; |
| 6276 | |
| 6277 | /* RelationalOperator: '<S666>/Operator' incorporates: |
| 6278 | * Constant: '<S472>/Constant3' |
| 6279 | * Constant: '<S664>/Constant1' |
| 6280 | */ |
| 6281 | L4_MABX_B.Operator_nc = (PROPB_REAX_CHANNEL_APV == |
| 6282 | L4_MABX_P.Constant1_Value_bk); |
| 6283 | |
| 6284 | /* Outputs for Enabled SubSystem: '<S584>/PropB_REAX_2_13' incorporates: |
| 6285 | * EnablePort: '<S586>/Enable' |
| 6286 | */ |
| 6287 | if (L4_MABX_B.Operator_nc) { |
| 6288 | /* S-Function (rti_commonblock): '<S586>/S-Function1' */ |
| 6289 | /* This comment workarounds a code generation problem */ |
| 6290 | |
| 6291 | /* dSPACE RTICAN RX Message Block: "PropB_REAX_2_13" Id:419426323 */ |
| 6292 | { |
| 6293 | UInt32 *CAN_Msg; |
| 6294 | static dsfloat time_old = 0.0; |
| 6295 | |
| 6296 | /* Read status and timestamp info (previous message) */ |
| 6297 | if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF013].timestamp != |
| 6298 | time_old) { |
| 6299 | /* ... save timestamp info for the calculation of the RX status |
| 6300 | during the consecutive sample hit*/ |
| 6301 | time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF013]. |
| 6302 | timestamp; |
| 6303 | |
| 6304 | /* ... set the processed flag to one */ |
| 6305 | L4_MABX_B.SFunction1_o3_pv = 1.0; |
| 6306 | L4_MABX_B.SFunction1_o4_c = (real_T) |
| 6307 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF013].timestamp; |
| 6308 | L4_MABX_B.SFunction1_o5_ni = (real_T) |
| 6309 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF013].deltatime; |
| 6310 | CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF013].data; |
| 6311 | |
| 6312 | /* Decode CAN message */ |
| 6313 | { |
| 6314 | { |
| 6315 | rtican_Signal_t CAN_Sgn; |
| 6316 | |
| 6317 | /* ...... "PropB_REAX_2_ActualHandwheelPos" (0|32, standard signal, signed int, little endian) */ |
| 6318 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 6319 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 6320 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[2]; |
| 6321 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[3]; |
| 6322 | L4_MABX_B.SFunction1_o1_cs = 0.0439453125 * ( ((real_T) |
| 6323 | CAN_Sgn.SignedSgn) ); |
| 6324 | |
| 6325 | /* ...... "PropB_REAX_2_EchoedStrWhlPos" (32|32, standard signal, signed int, little endian) */ |
| 6326 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 6327 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 6328 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[6]; |
| 6329 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[7]; |
| 6330 | L4_MABX_B.SFunction1_o2_jnu = 0.0439453125 * ( ((real_T) |
| 6331 | CAN_Sgn.SignedSgn) ); |
| 6332 | } |
| 6333 | } |
| 6334 | } else { |
| 6335 | /* set RX status to 0 because no new message has arrived */ |
| 6336 | L4_MABX_B.SFunction1_o3_pv = 0.0; |
| 6337 | } |
| 6338 | } |
| 6339 | } |
| 6340 | |
| 6341 | /* End of Outputs for SubSystem: '<S584>/PropB_REAX_2_13' */ |
| 6342 | |
| 6343 | /* RelationalOperator: '<S665>/Operator' incorporates: |
| 6344 | * Constant: '<S472>/Constant3' |
| 6345 | * Constant: '<S664>/Constant' |
| 6346 | */ |
| 6347 | L4_MABX_B.Operator_cqv = (PROPB_REAX_CHANNEL_APV == |
| 6348 | L4_MABX_P.Constant_Value_prb); |
| 6349 | |
| 6350 | /* RelationalOperator: '<S667>/Operator' incorporates: |
| 6351 | * Constant: '<S472>/Constant3' |
| 6352 | * Constant: '<S664>/Constant2' |
| 6353 | */ |
| 6354 | L4_MABX_B.Operator_j2 = (PROPB_REAX_CHANNEL_APV == |
| 6355 | L4_MABX_P.Constant2_Value_bj); |
| 6356 | |
| 6357 | /* RelationalOperator: '<S668>/Operator' incorporates: |
| 6358 | * Constant: '<S472>/Constant3' |
| 6359 | * Constant: '<S664>/Constant3' |
| 6360 | */ |
| 6361 | L4_MABX_B.Operator_af = (PROPB_REAX_CHANNEL_APV == |
| 6362 | L4_MABX_P.Constant3_Value_lj); |
| 6363 | |
| 6364 | /* RelationalOperator: '<S669>/Operator' incorporates: |
| 6365 | * Constant: '<S472>/Constant3' |
| 6366 | * Constant: '<S664>/Constant4' |
| 6367 | */ |
| 6368 | L4_MABX_B.Operator_ey = (PROPB_REAX_CHANNEL_APV == |
| 6369 | L4_MABX_P.Constant4_Value_j1); |
| 6370 | |
| 6371 | /* RelationalOperator: '<S670>/Operator' incorporates: |
| 6372 | * Constant: '<S472>/Constant3' |
| 6373 | * Constant: '<S664>/Constant5' |
| 6374 | */ |
| 6375 | L4_MABX_B.Operator_j4 = (PROPB_REAX_CHANNEL_APV == |
| 6376 | L4_MABX_P.Constant5_Value_bs); |
| 6377 | |
| 6378 | /* Logic: '<S472>/OR' */ |
| 6379 | L4_MABX_B.EnablePropB_ReAX_CAN6 = (L4_MABX_B.Operator_cqv || |
| 6380 | L4_MABX_B.Operator_j2 || L4_MABX_B.Operator_af || L4_MABX_B.Operator_ey || |
| 6381 | L4_MABX_B.Operator_j4); |
| 6382 | |
| 6383 | /* Outputs for Enabled SubSystem: '<S585>/PropB_REAX_2_13' incorporates: |
| 6384 | * EnablePort: '<S587>/Enable' |
| 6385 | */ |
| 6386 | if (L4_MABX_B.EnablePropB_ReAX_CAN6) { |
| 6387 | /* S-Function (rti_commonblock): '<S587>/S-Function1' */ |
| 6388 | /* This comment workarounds a code generation problem */ |
| 6389 | |
| 6390 | /* dSPACE RTICAN RX Message Block: "PropB_REAX_2_13" Id:486535187 */ |
| 6391 | { |
| 6392 | UInt32 *CAN_Msg; |
| 6393 | static dsfloat time_old = 0.0; |
| 6394 | |
| 6395 | /* Read status and timestamp info (previous message) */ |
| 6396 | if (can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF013].timestamp != |
| 6397 | time_old) { |
| 6398 | /* ... save timestamp info for the calculation of the RX status |
| 6399 | during the consecutive sample hit*/ |
| 6400 | time_old = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF013]. |
| 6401 | timestamp; |
| 6402 | |
| 6403 | /* ... set the processed flag to one */ |
| 6404 | L4_MABX_B.SFunction1_o3_l1 = 1.0; |
| 6405 | L4_MABX_B.SFunction1_o4_k1 = (real_T) |
| 6406 | can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF013].timestamp; |
| 6407 | L4_MABX_B.SFunction1_o5_j = (real_T) |
| 6408 | can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF013].deltatime; |
| 6409 | CAN_Msg = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF013].data; |
| 6410 | |
| 6411 | /* Decode CAN message */ |
| 6412 | { |
| 6413 | { |
| 6414 | rtican_Signal_t CAN_Sgn; |
| 6415 | |
| 6416 | /* ...... "PropB_REAX_2_ActualHandwheelPos" (0|32, standard signal, signed int, little endian) */ |
| 6417 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 6418 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 6419 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[2]; |
| 6420 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[3]; |
| 6421 | L4_MABX_B.SFunction1_o1_ph = 0.0439453125 * ( ((real_T) |
| 6422 | CAN_Sgn.SignedSgn) ); |
| 6423 | |
| 6424 | /* ...... "PropB_REAX_2_EchoedStrWhlPos" (32|32, standard signal, signed int, little endian) */ |
| 6425 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 6426 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 6427 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[6]; |
| 6428 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[7]; |
| 6429 | L4_MABX_B.SFunction1_o2_g5 = 0.0439453125 * ( ((real_T) |
| 6430 | CAN_Sgn.SignedSgn) ); |
| 6431 | } |
| 6432 | } |
| 6433 | } else { |
| 6434 | /* set RX status to 0 because no new message has arrived */ |
| 6435 | L4_MABX_B.SFunction1_o3_l1 = 0.0; |
| 6436 | } |
| 6437 | } |
| 6438 | } |
| 6439 | |
| 6440 | /* End of Outputs for SubSystem: '<S585>/PropB_REAX_2_13' */ |
| 6441 | |
| 6442 | /* Switch: '<S449>/Switch' */ |
| 6443 | if (L4_MABX_B.Operator_nc) { |
| 6444 | ReAX_ActualHandwheelPos = L4_MABX_B.SFunction1_o1_cs; |
| 6445 | } else { |
| 6446 | ReAX_ActualHandwheelPos = L4_MABX_B.SFunction1_o1_ph; |
| 6447 | } |
| 6448 | |
| 6449 | /* S-Function (dsa_tcpip_setup_sfcn): '<S405>/dsa_tcpip_setup' */ |
| 6450 | |
| 6451 | /* Level2 S-Function Block: '<S405>/dsa_tcpip_setup' (dsa_tcpip_setup_sfcn) */ |
| 6452 | { |
| 6453 | SimStruct *rts = L4_MABX_M->childSfunctions[3]; |
| 6454 | ssSetOutputPortSignal(rts, 0, &EthernetLinkStatus); |
| 6455 | sfcnOutputs(rts,0); |
| 6456 | } |
| 6457 | |
| 6458 | /* Constant: '<S3>/Enable' */ |
| 6459 | L4_MABX_B.Enable = L4_MABX_P.Enable_Value; |
| 6460 | |
| 6461 | /* DiscretePulseGenerator: '<S404>/Heartbeat' */ |
| 6462 | L4_MABX_B.Heartbeat = (L4_MABX_DW.clockTickCounter < L4_MABX_P.Heartbeat_Duty) |
| 6463 | && (L4_MABX_DW.clockTickCounter >= 0) ? L4_MABX_P.Heartbeat_Amp : 0.0; |
| 6464 | if (L4_MABX_DW.clockTickCounter >= L4_MABX_P.Heartbeat_Period - 1.0) { |
| 6465 | L4_MABX_DW.clockTickCounter = 0; |
| 6466 | } else { |
| 6467 | L4_MABX_DW.clockTickCounter++; |
| 6468 | } |
| 6469 | |
| 6470 | /* End of DiscretePulseGenerator: '<S404>/Heartbeat' */ |
| 6471 | |
| 6472 | /* DataTypeConversion: '<S404>/Cast To Boolean' */ |
| 6473 | MABX_Heartbeat = (L4_MABX_B.Heartbeat != 0.0); |
| 6474 | |
| 6475 | /* UnitDelay: '<S3>/Unit_Delay' */ |
| 6476 | L4_MABX_B.EStop_j = L4_MABX_DW.Unit_Delay_80_DSTATE; |
| 6477 | L4_MABX_B.EnableSW = L4_MABX_DW.Unit_Delay_81_DSTATE; |
| 6478 | L4_MABX_B.EngageReq = L4_MABX_DW.Unit_Delay_48_DSTATE; |
| 6479 | L4_MABX_B.LogPB = L4_MABX_DW.Unit_Delay_83_DSTATE; |
| 6480 | L4_MABX_B.AutonomousEnabled = L4_MABX_DW.Unit_Delay_45_DSTATE; |
| 6481 | L4_MABX_B.MABX_Mode_h = L4_MABX_DW.Unit_Delay_47_DSTATE; |
| 6482 | L4_MABX_B.BrakeSW_j = L4_MABX_DW.Unit_Delay_84_DSTATE; |
| 6483 | |
| 6484 | /* BusCreator: '<S404>/Bus Creator' */ |
| 6485 | L4_MABX_B.BusCreator.Heartbeat = MABX_Heartbeat; |
| 6486 | L4_MABX_B.BusCreator.EStop = L4_MABX_B.EStop_j; |
| 6487 | L4_MABX_B.BusCreator.EnableSW = L4_MABX_B.EnableSW; |
| 6488 | L4_MABX_B.BusCreator.EngageReq = L4_MABX_B.EngageReq; |
| 6489 | L4_MABX_B.BusCreator.LogEventPB = L4_MABX_B.LogPB; |
| 6490 | L4_MABX_B.BusCreator.AutonomousEnabled = L4_MABX_B.AutonomousEnabled; |
| 6491 | L4_MABX_B.BusCreator.MABX_Mode = L4_MABX_B.MABX_Mode_h; |
| 6492 | L4_MABX_B.BusCreator.BrakeSW = L4_MABX_B.BrakeSW_j; |
| 6493 | |
| 6494 | /* S-Function (dsa_gen_tx_RTMapsEncode_sfun): '<S413>/Encoder' */ |
| 6495 | Update_Tx_RTMapsEncode((RTMapsTX*)&L4_MABX_B.BusCreator, |
| 6496 | &L4_MABX_B.Encoder_o1[0], &L4_MABX_B.Encoder_o2); |
| 6497 | |
| 6498 | /* S-Function (dsa_tcpip_udp_sfcn): '<S406>/TCPIP_Com' */ |
| 6499 | |
| 6500 | /* Level2 S-Function Block: '<S406>/TCPIP_Com' (dsa_tcpip_udp_sfcn) */ |
| 6501 | { |
| 6502 | SimStruct *rts = L4_MABX_M->childSfunctions[4]; |
| 6503 | sfcnOutputs(rts,0); |
| 6504 | } |
| 6505 | |
| 6506 | /* DataTypeConversion: '<S403>/Data Type Conversion' */ |
| 6507 | L4_MABX_B.DataTypeConversion_aq = L4_MABX_B.TCPIP_Com_o2; |
| 6508 | |
| 6509 | /* S-Function (dsa_gen_rx_RTMapsDecode_sfun): '<S410>/Decoder' */ |
| 6510 | Update_Rx_RTMapsDecode((uint8_T*)&L4_MABX_B.TCPIP_Com_o3[0], |
| 6511 | L4_MABX_B.DataTypeConversion_aq, L4_MABX_B.TCPIP_Com_o1[2], |
| 6512 | &L4_MABX_B.Decoder_o1, &L4_MABX_B.Decoder_o2, &L4_MABX_B.Decoder_o3); |
| 6513 | |
| 6514 | /* RelationalOperator: '<S412>/Compare' incorporates: |
| 6515 | * Constant: '<S412>/Constant' |
| 6516 | */ |
| 6517 | L4_MABX_B.Compare_c = ((int32_T)L4_MABX_B.Decoder_o1.Heartbeat > (int32_T) |
| 6518 | L4_MABX_P.Constant_Value_ap); |
| 6519 | |
| 6520 | /* UnitDelay: '<S411>/Delay Input1' */ |
| 6521 | L4_MABX_B.Uk1_f = L4_MABX_DW.DelayInput1_DSTATE_n; |
| 6522 | |
| 6523 | /* RelationalOperator: '<S411>/FixPt Relational Operator' */ |
| 6524 | L4_MABX_B.FixPtRelationalOperator_i = ((int32_T)L4_MABX_B.Compare_c > (int32_T) |
| 6525 | L4_MABX_B.Uk1_f); |
| 6526 | |
| 6527 | /* UnitDelay: '<S409>/Unit Delay' */ |
| 6528 | L4_MABX_B.UnitDelay_f = L4_MABX_DW.UnitDelay_DSTATE_k; |
| 6529 | |
| 6530 | /* Switch: '<S409>/Switch' incorporates: |
| 6531 | * Constant: '<S409>/Constant1' |
| 6532 | */ |
| 6533 | if (L4_MABX_B.FixPtRelationalOperator_i) { |
| 6534 | L4_MABX_B.Count = L4_MABX_P.Constant1_Value_e; |
| 6535 | } else { |
| 6536 | /* Sum: '<S409>/Sum' incorporates: |
| 6537 | * Constant: '<S409>/Constant' |
| 6538 | */ |
| 6539 | L4_MABX_B.Sum_l = L4_MABX_P.Constant_Value_l + L4_MABX_B.UnitDelay_f; |
| 6540 | L4_MABX_B.Count = L4_MABX_B.Sum_l; |
| 6541 | } |
| 6542 | |
| 6543 | /* End of Switch: '<S409>/Switch' */ |
| 6544 | |
| 6545 | /* Switch: '<S409>/Switch1' incorporates: |
| 6546 | * Constant: '<S409>/Constant2' |
| 6547 | * Constant: '<S409>/Constant3' |
| 6548 | */ |
| 6549 | if (L4_MABX_B.Count > L4_MABX_P.Switch1_Threshold) { |
| 6550 | Heartbeat_Ok = L4_MABX_P.Constant2_Value_e; |
| 6551 | } else { |
| 6552 | Heartbeat_Ok = L4_MABX_P.Constant3_Value_f; |
| 6553 | } |
| 6554 | |
| 6555 | /* End of Switch: '<S409>/Switch1' */ |
| 6556 | |
| 6557 | /* Logic: '<S403>/AND' */ |
| 6558 | RTMapsOk = ((EthernetLinkStatus != 0.0) && Heartbeat_Ok); |
| 6559 | |
| 6560 | /* Switch: '<S403>/Switch9' incorporates: |
| 6561 | * Constant: '<S403>/Failure' |
| 6562 | */ |
| 6563 | if (RTMapsOk) { |
| 6564 | /* Gain: '<S403>/for_logging7' */ |
| 6565 | L4_MABX_B.SupervisorMode_b = (int8_T)(((uint32_T)L4_MABX_P.for_logging7_Gain |
| 6566 | * L4_MABX_B.Decoder_o1.SupervisorMode) >> 7); |
| 6567 | SupervisorMode = (uint8_T)L4_MABX_B.SupervisorMode_b; |
| 6568 | } else { |
| 6569 | SupervisorMode = L4_MABX_P.Failure_Value_k; |
| 6570 | } |
| 6571 | |
| 6572 | /* End of Switch: '<S403>/Switch9' */ |
| 6573 | |
| 6574 | /* RelationalOperator: '<S408>/Operator' incorporates: |
| 6575 | * Constant: '<S403>/Supervisor_Autonomous_Mode' |
| 6576 | */ |
| 6577 | L4_MABX_B.Operator_m1 = (L4_MABX_P.Supervisor_Autonomous_Mode_Valu == |
| 6578 | SupervisorMode); |
| 6579 | |
| 6580 | /* Logic: '<S403>/AND1' */ |
| 6581 | L4_MABX_B.SystemsOk = (RTMapsOk && L4_MABX_B.Operator_m1); |
| 6582 | |
| 6583 | /* Switch: '<S403>/Switch' incorporates: |
| 6584 | * Constant: '<S403>/No Data' |
| 6585 | * Switch: '<S403>/Switch1' |
| 6586 | * Switch: '<S403>/Switch3' |
| 6587 | * Switch: '<S403>/Switch4' |
| 6588 | * Switch: '<S403>/Switch5' |
| 6589 | */ |
| 6590 | if (RTMapsOk) { |
| 6591 | /* Gain: '<S403>/for_logging' */ |
| 6592 | L4_MABX_B.for_logging = L4_MABX_P.for_logging_Gain * |
| 6593 | L4_MABX_B.Decoder_o1.CurrentAzimuth; |
| 6594 | CurrentAzimuth_rad = L4_MABX_B.for_logging; |
| 6595 | |
| 6596 | /* Gain: '<S403>/for_logging1' */ |
| 6597 | L4_MABX_B.for_logging1 = L4_MABX_P.for_logging1_Gain * |
| 6598 | L4_MABX_B.Decoder_o1.TargetAzimuth; |
| 6599 | TargetAzimuth_rad = L4_MABX_B.for_logging1; |
| 6600 | |
| 6601 | /* Gain: '<S403>/m//s_to_km//h_2' */ |
| 6602 | L4_MABX_B.ms_to_kmh_2 = L4_MABX_P.ms_to_kmh_2_Gain * |
| 6603 | L4_MABX_B.Decoder_o1.TargetVelocity; |
| 6604 | TargetVelocity_kph = L4_MABX_B.ms_to_kmh_2; |
| 6605 | |
| 6606 | /* Gain: '<S403>/for_logging2' */ |
| 6607 | L4_MABX_B.for_logging2 = L4_MABX_P.for_logging2_Gain * |
| 6608 | L4_MABX_B.Decoder_o1.Curvature; |
| 6609 | Curvature = L4_MABX_B.for_logging2; |
| 6610 | |
| 6611 | /* Gain: '<S403>/for_logging3' */ |
| 6612 | L4_MABX_B.for_logging3 = L4_MABX_P.for_logging3_Gain * |
| 6613 | L4_MABX_B.Decoder_o1.CrosstrackError; |
| 6614 | CrosstrackError = L4_MABX_B.for_logging3; |
| 6615 | } else { |
| 6616 | CurrentAzimuth_rad = L4_MABX_P.NoData_Value; |
| 6617 | TargetAzimuth_rad = L4_MABX_P.NoData_Value; |
| 6618 | TargetVelocity_kph = L4_MABX_P.NoData_Value; |
| 6619 | Curvature = L4_MABX_P.NoData_Value; |
| 6620 | CrosstrackError = L4_MABX_P.NoData_Value; |
| 6621 | } |
| 6622 | |
| 6623 | /* End of Switch: '<S403>/Switch' */ |
| 6624 | |
| 6625 | /* Outputs for Atomic SubSystem: '<S65>/Task_10ms' */ |
| 6626 | /* UnitDelay: '<S97>/Unit Delay1' */ |
| 6627 | L4_MABX_B.UnitDelay1_f = L4_MABX_DW.UnitDelay1_DSTATE_m; |
| 6628 | |
| 6629 | /* UnitDelay: '<S76>/Unit_Delay' */ |
| 6630 | L4_MABX_B.Unit_Delay_nh = L4_MABX_DW.Unit_Delay_DSTATE_fv; |
| 6631 | |
| 6632 | /* RelationalOperator: '<S100>/Compare' incorporates: |
| 6633 | * Constant: '<S100>/Constant' |
| 6634 | */ |
| 6635 | L4_MABX_B.Compare_jp = ((int32_T)L4_MABX_B.Unit_Delay_nh <= (int32_T) |
| 6636 | L4_MABX_P.Constant_Value_io); |
| 6637 | |
| 6638 | /* UnitDelay: '<S98>/Delay Input1' */ |
| 6639 | L4_MABX_B.Uk1_d = L4_MABX_DW.DelayInput1_DSTATE_d; |
| 6640 | |
| 6641 | /* RelationalOperator: '<S98>/FixPt Relational Operator' */ |
| 6642 | L4_MABX_B.FixPtRelationalOperator_o = ((int32_T)L4_MABX_B.Compare_jp > |
| 6643 | (int32_T)L4_MABX_B.Uk1_d); |
| 6644 | |
| 6645 | /* UnitDelay: '<S97>/Unit Delay' */ |
| 6646 | L4_MABX_B.UnitDelay_i3 = L4_MABX_DW.UnitDelay_DSTATE_b1; |
| 6647 | |
| 6648 | /* Logic: '<S97>/OR' */ |
| 6649 | L4_MABX_B.OR_e = (L4_MABX_B.FixPtRelationalOperator_o || |
| 6650 | L4_MABX_B.UnitDelay_i3); |
| 6651 | |
| 6652 | /* Switch: '<S97>/Switch' incorporates: |
| 6653 | * Constant: '<S97>/Constant0' |
| 6654 | */ |
| 6655 | if (L4_MABX_B.OR_e) { |
| 6656 | /* Sum: '<S97>/Sum' incorporates: |
| 6657 | * Constant: '<S97>/Constant1' |
| 6658 | */ |
| 6659 | L4_MABX_B.Sum_gp = L4_MABX_B.UnitDelay1_f + L4_MABX_P.Constant1_Value; |
| 6660 | L4_MABX_B.Switch_a = L4_MABX_B.Sum_gp; |
| 6661 | } else { |
| 6662 | L4_MABX_B.Switch_a = L4_MABX_P.Constant0_Value; |
| 6663 | } |
| 6664 | |
| 6665 | /* End of Switch: '<S97>/Switch' */ |
| 6666 | |
| 6667 | /* RelationalOperator: '<S99>/Compare' incorporates: |
| 6668 | * Constant: '<S99>/Constant' |
| 6669 | */ |
| 6670 | L4_MABX_B.Compare_fh = (L4_MABX_B.Switch_a > L4_MABX_P.Constant_Value_hq); |
| 6671 | |
| 6672 | /* Gain: '<S97>/Gain' incorporates: |
| 6673 | * Constant: '<S95>/2000ms Delay' |
| 6674 | */ |
| 6675 | L4_MABX_B.Gain_co = (uint32_T)L4_MABX_P.Gain_Gain_b * |
| 6676 | L4_MABX_P.u000msDelay_Value; |
| 6677 | |
| 6678 | /* RelationalOperator: '<S97>/LessThanOrEqual' */ |
| 6679 | L4_MABX_B.LessThanOrEqual_g = (L4_MABX_B.Switch_a <= (real_T)L4_MABX_B.Gain_co |
| 6680 | * 1.9073486328125E-6); |
| 6681 | |
| 6682 | /* Logic: '<S97>/AND' */ |
| 6683 | L4_MABX_B.AND_f = (L4_MABX_B.Compare_fh && L4_MABX_B.LessThanOrEqual_g); |
| 6684 | |
| 6685 | /* Logic: '<S95>/NOT1' */ |
| 6686 | L4_MABX_B.NOT1_h = !L4_MABX_B.AND_f; |
| 6687 | |
| 6688 | /* Logic: '<S76>/AND1' */ |
| 6689 | L4_MABX_B.AND1_i = (EStop && EnableSw && BrakeSW && L4_MABX_B.NOT1_h); |
| 6690 | |
| 6691 | /* Sum: '<S96>/Subtract' */ |
| 6692 | L4_MABX_B.Subtract_a = TargetVelocity_kph - L4_MABX_B.SFunction1_o1_gd; |
| 6693 | |
| 6694 | /* RelationalOperator: '<S101>/Compare' incorporates: |
| 6695 | * Constant: '<S101>/Constant' |
| 6696 | */ |
| 6697 | L4_MABX_B.Compare_is = (L4_MABX_B.Subtract_a >= |
| 6698 | L4_MABX_P.CompareToConstant_const_a); |
| 6699 | |
| 6700 | /* Logic: '<S96>/AND' */ |
| 6701 | L4_MABX_B.AND_a = (L4_MABX_B.AND1_i && EngagePB && L4_MABX_B.Compare_is); |
| 6702 | |
| 6703 | /* Logic: '<S76>/OR' */ |
| 6704 | L4_MABX_B.OR_l = (L4_MABX_B.Unit_Delay_nh || L4_MABX_B.AND_a); |
| 6705 | |
| 6706 | /* Logic: '<S76>/AND' */ |
| 6707 | L4_MABX_B.AutonomousEnabled_d = (L4_MABX_B.SystemsOk && L4_MABX_B.AND1_i && |
| 6708 | L4_MABX_B.OR_l); |
| 6709 | |
| 6710 | /* Logic: '<S83>/Logical Operator' */ |
| 6711 | L4_MABX_B.LogicalOperator_d = !L4_MABX_B.AutonomousEnabled_d; |
| 6712 | |
| 6713 | /* Outputs for Atomic SubSystem: '<S83>/If_Then_Else' */ |
| 6714 | |
| 6715 | /* Constant: '<S83>/APTC_PEDAL_POSITION_OVR_APV' incorporates: |
| 6716 | * Constant: '<S83>/APTC_DESIRED_PEDAL_POSITION_APV' |
| 6717 | */ |
| 6718 | L4_MABX_If_Then_Else(L4_MABX_P.APTC_PEDAL_POSITION_OVR_APV_Val, |
| 6719 | L4_MABX_P.APTC_DESIRED_PEDAL_POSITION_APV, |
| 6720 | Pedal_pwm_position, &L4_MABX_B.If_Then_Else_oy); |
| 6721 | |
| 6722 | /* End of Outputs for SubSystem: '<S83>/If_Then_Else' */ |
| 6723 | |
| 6724 | /* DataTypeConversion: '<S83>/Data Type Conversion1' */ |
| 6725 | L4_MABX_B.DataTypeConversion1_ht = L4_MABX_B.SFunction1_o5_nl; |
| 6726 | |
| 6727 | /* Lookup_n-D: '<S83>/2-D Lookup Table' */ |
| 6728 | L4_MABX_B.uDLookupTable = look2_binlcapw(L4_MABX_B.If_Then_Else_oy.Switch, |
| 6729 | L4_MABX_B.DataTypeConversion1_ht, APTC_TRQ_PED_TRQ_POS_STEP_MPV, |
| 6730 | APTC_TRQ_PED_TRQ_ESPD_STEP_MPV, APTC_TRQ_PED_TRQ_DATA_MPV, |
| 6731 | L4_MABX_P.uDLookupTable_maxIndex, 8U); |
| 6732 | |
| 6733 | /* DataTypeConversion: '<S77>/Data Type Conversion5' */ |
| 6734 | L4_MABX_B.DataTypeConversion5_o = L4_MABX_B.SFunction1_o1_gd; |
| 6735 | |
| 6736 | /* RateTransition: '<S81>/TmpRTBAtSignal Conversion1Inport1' */ |
| 6737 | if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) { |
| 6738 | L4_MABX_B.distanceSpdTarget_e = L4_MABX_DW.TmpRTBAtSignalConversion1Inport; |
| 6739 | } |
| 6740 | |
| 6741 | /* MultiPortSwitch: '<S81>/Multiport Switch' incorporates: |
| 6742 | * Constant: '<S81>/LONG_SPEED_SRC_SELECTOR_APV' |
| 6743 | */ |
| 6744 | switch (LONG_SPEED_SRC_SELECTOR_APV) { |
| 6745 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH: |
| 6746 | /* SignalConversion: '<S81>/Signal Conversion1' */ |
| 6747 | L4_MABX_B.Vehicle_speed_target_g = L4_MABX_B.distanceSpdTarget_e; |
| 6748 | L4_MABX_B.Vehicle_speed_target_o = L4_MABX_B.Vehicle_speed_target_g; |
| 6749 | break; |
| 6750 | |
| 6751 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE: |
| 6752 | /* SignalConversion: '<S81>/Signal Conversion4' incorporates: |
| 6753 | * Constant: '<S81>/VSPD_TARGET_KPH_APV' |
| 6754 | */ |
| 6755 | L4_MABX_B.Vehicle_speed_target_o5 = VSPD_TARGET_KPH_APV; |
| 6756 | L4_MABX_B.Vehicle_speed_target_o = L4_MABX_B.Vehicle_speed_target_o5; |
| 6757 | break; |
| 6758 | |
| 6759 | default: |
| 6760 | /* SignalConversion: '<S81>/Signal Conversion9' */ |
| 6761 | L4_MABX_B.Vehicle_speed_target_k = TargetVelocity_kph; |
| 6762 | L4_MABX_B.Vehicle_speed_target_o = L4_MABX_B.Vehicle_speed_target_k; |
| 6763 | break; |
| 6764 | } |
| 6765 | |
| 6766 | /* SignalConversion: '<S81>/Signal Conversion16' */ |
| 6767 | L4_MABX_B.VSPD_TARGET_KPH_APV_g = L4_MABX_B.Vehicle_speed_target_o; |
| 6768 | |
| 6769 | /* Saturate: '<S81>/Saturation9' incorporates: |
| 6770 | * Constant: '<S81>/VSPD_HYST_KPH_APV' |
| 6771 | */ |
| 6772 | DeltaTime = L4_MABX_P.VSPD_HYST_KPH_APV_Value; |
| 6773 | Time56 = L4_MABX_P.Saturation9_LowerSat; |
| 6774 | AccelerationAverage = L4_MABX_P.Saturation9_UpperSat; |
| 6775 | if (DeltaTime > AccelerationAverage) { |
| 6776 | L4_MABX_B.VSPD_HYST_KPH_APV_f = AccelerationAverage; |
| 6777 | } else if (DeltaTime < Time56) { |
| 6778 | L4_MABX_B.VSPD_HYST_KPH_APV_f = Time56; |
| 6779 | } else { |
| 6780 | L4_MABX_B.VSPD_HYST_KPH_APV_f = DeltaTime; |
| 6781 | } |
| 6782 | |
| 6783 | /* End of Saturate: '<S81>/Saturation9' */ |
| 6784 | |
| 6785 | /* Sum: '<S109>/Add' */ |
| 6786 | L4_MABX_B.Add_k = L4_MABX_B.VSPD_TARGET_KPH_APV_g + |
| 6787 | L4_MABX_B.VSPD_HYST_KPH_APV_f; |
| 6788 | |
| 6789 | /* RelationalOperator: '<S109>/Relational Operator' */ |
| 6790 | L4_MABX_B.f_vspd_geq_than_target_plus_hys = (L4_MABX_B.DataTypeConversion5_o >= |
| 6791 | L4_MABX_B.Add_k); |
| 6792 | |
| 6793 | /* Saturate: '<S81>/Saturation1' incorporates: |
| 6794 | * Constant: '<S81>/VSPD_BRAKE_STOP_THRESH_KPH_APV' |
| 6795 | */ |
| 6796 | DeltaTime = L4_MABX_P.VSPD_BRAKE_STOP_THRESH_KPH_APV_; |
| 6797 | Time56 = L4_MABX_P.Saturation1_LowerSat; |
| 6798 | AccelerationAverage = L4_MABX_P.Saturation1_UpperSat; |
| 6799 | if (DeltaTime > AccelerationAverage) { |
| 6800 | L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b = AccelerationAverage; |
| 6801 | } else if (DeltaTime < Time56) { |
| 6802 | L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b = Time56; |
| 6803 | } else { |
| 6804 | L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b = DeltaTime; |
| 6805 | } |
| 6806 | |
| 6807 | /* End of Saturate: '<S81>/Saturation1' */ |
| 6808 | |
| 6809 | /* RelationalOperator: '<S109>/Relational Operator1' */ |
| 6810 | L4_MABX_B.f_target_is_stop_thresh = (L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b |
| 6811 | == L4_MABX_B.VSPD_TARGET_KPH_APV_g); |
| 6812 | |
| 6813 | /* RelationalOperator: '<S205>/Compare' incorporates: |
| 6814 | * Constant: '<S205>/Constant' |
| 6815 | */ |
| 6816 | L4_MABX_B.Compare_eu = (L4_MABX_B.VSPD_TARGET_KPH_APV_g == |
| 6817 | L4_MABX_P.Constant_Value_k); |
| 6818 | |
| 6819 | /* RelationalOperator: '<S109>/Relational Operator2' */ |
| 6820 | L4_MABX_B.RelationalOperator2_p = (L4_MABX_B.VSPD_HYST_KPH_APV_f >= |
| 6821 | L4_MABX_B.VSPD_TARGET_KPH_APV_g); |
| 6822 | |
| 6823 | /* RelationalOperator: '<S109>/Relational Operator3' */ |
| 6824 | L4_MABX_B.RelationalOperator3 = (L4_MABX_B.VSPD_HYST_KPH_APV_f >= |
| 6825 | L4_MABX_B.DataTypeConversion5_o); |
| 6826 | |
| 6827 | /* Logic: '<S109>/Logical Operator' */ |
| 6828 | L4_MABX_B.f_vspd_leq_than_hyst_and_target = (L4_MABX_B.RelationalOperator2_p && |
| 6829 | L4_MABX_B.RelationalOperator3); |
| 6830 | |
| 6831 | /* Logic: '<S109>/Logical Operator1' */ |
| 6832 | L4_MABX_B.LogicalOperator1_m = (L4_MABX_B.f_vspd_geq_than_target_plus_hys || |
| 6833 | L4_MABX_B.f_target_is_stop_thresh || L4_MABX_B.Compare_eu || |
| 6834 | L4_MABX_B.f_vspd_leq_than_hyst_and_target); |
| 6835 | |
| 6836 | /* DataTypeConversion: '<S77>/Data Type Conversion4' */ |
| 6837 | L4_MABX_B.DataTypeConversion4_d5 = L4_MABX_B.AutonomousEnabled_d; |
| 6838 | |
| 6839 | /* Logic: '<S109>/Logical Operator2' */ |
| 6840 | L4_MABX_B.F_Brake_control_active = (L4_MABX_B.LogicalOperator1_m && |
| 6841 | L4_MABX_B.DataTypeConversion4_d5); |
| 6842 | |
| 6843 | /* DataTypeConversion: '<S79>/Data Type Conversion4' */ |
| 6844 | L4_MABX_B.DataTypeConversion4_ib = L4_MABX_B.SFunction1_o1_gd; |
| 6845 | |
| 6846 | /* DataTypeConversion: '<S77>/Data Type Conversion1' */ |
| 6847 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_fp; |
| 6848 | if (PositionFinalLimited < 256.0) { |
| 6849 | if (PositionFinalLimited >= 0.0) { |
| 6850 | starting_index = (uint8_T)PositionFinalLimited; |
| 6851 | } else { |
| 6852 | starting_index = 0U; |
| 6853 | } |
| 6854 | } else { |
| 6855 | starting_index = MAX_uint8_T; |
| 6856 | } |
| 6857 | |
| 6858 | L4_MABX_B.DataTypeConversion1_ba = starting_index; |
| 6859 | |
| 6860 | /* End of DataTypeConversion: '<S77>/Data Type Conversion1' */ |
| 6861 | |
| 6862 | /* DataTypeConversion: '<S77>/Data Type Conversion3' */ |
| 6863 | L4_MABX_B.BrkPedArbBrakeSwitch_c = (ENUM_J1939_SWITCH_T) |
| 6864 | L4_MABX_B.DataTypeConversion1_ba; |
| 6865 | |
| 6866 | /* DataTypeConversion: '<S209>/Data Type Conversion1' */ |
| 6867 | L4_MABX_B.DataTypeConversion1_cy = L4_MABX_B.BrkPedArbBrakeSwitch_c; |
| 6868 | |
| 6869 | /* RelationalOperator: '<S215>/Compare' incorporates: |
| 6870 | * Constant: '<S215>/Constant' |
| 6871 | */ |
| 6872 | L4_MABX_B.Compare_e5 = (L4_MABX_B.DataTypeConversion1_cy == |
| 6873 | L4_MABX_P.CompareToConstant2_const); |
| 6874 | |
| 6875 | /* Logic: '<S209>/Logical Operator2' */ |
| 6876 | L4_MABX_B.LogicalOperator2_n = !L4_MABX_B.Compare_e5; |
| 6877 | |
| 6878 | /* DataTypeConversion: '<S209>/Data Type Conversion5' */ |
| 6879 | PositionFinalLimited = floor(L4_MABX_B.SFunction1_o4_nj); |
| 6880 | if (rtIsNaN(PositionFinalLimited) || rtIsInf(PositionFinalLimited)) { |
| 6881 | PositionFinalLimited = 0.0; |
| 6882 | } else { |
| 6883 | PositionFinalLimited = fmod(PositionFinalLimited, 256.0); |
| 6884 | } |
| 6885 | |
| 6886 | L4_MABX_B.DataTypeConversion5_pw = (uint8_T)(PositionFinalLimited < 0.0 ? |
| 6887 | (int32_T)(uint8_T)-(int8_T)(uint8_T)-PositionFinalLimited : (int32_T) |
| 6888 | (uint8_T)PositionFinalLimited); |
| 6889 | |
| 6890 | /* End of DataTypeConversion: '<S209>/Data Type Conversion5' */ |
| 6891 | |
| 6892 | /* DataTypeConversion: '<S209>/Data Type Conversion3' */ |
| 6893 | L4_MABX_B.DataTypeConversion3_l = (ENUM_J1939_SWITCH_T) |
| 6894 | L4_MABX_B.DataTypeConversion5_pw; |
| 6895 | |
| 6896 | /* RelationalOperator: '<S213>/Compare' incorporates: |
| 6897 | * Constant: '<S213>/Constant' |
| 6898 | */ |
| 6899 | L4_MABX_B.Compare_ih = (L4_MABX_B.DataTypeConversion3_l == |
| 6900 | L4_MABX_P.CompareToConstant_const_e); |
| 6901 | |
| 6902 | /* RelationalOperator: '<S214>/Compare' incorporates: |
| 6903 | * Constant: '<S214>/Constant' |
| 6904 | */ |
| 6905 | L4_MABX_B.Compare_exd = (L4_MABX_B.DataTypeConversion3_l == |
| 6906 | L4_MABX_P.CompareToConstant1_const_j); |
| 6907 | |
| 6908 | /* Logic: '<S209>/BrakingActive2' */ |
| 6909 | L4_MABX_B.BrakingActive2 = (L4_MABX_B.Compare_ih || L4_MABX_B.Compare_exd); |
| 6910 | |
| 6911 | /* Logic: '<S209>/BrakingActive1' */ |
| 6912 | L4_MABX_B.f_brake_sw_off = (L4_MABX_B.LogicalOperator2_n && |
| 6913 | L4_MABX_B.BrakingActive2); |
| 6914 | |
| 6915 | /* RelationalOperator: '<S216>/Compare' incorporates: |
| 6916 | * Constant: '<S216>/Constant' |
| 6917 | */ |
| 6918 | L4_MABX_B.Compare_ay = (L4_MABX_B.SPN524_TransSelectedGear > |
| 6919 | L4_MABX_P.Constant_Value_il); |
| 6920 | |
| 6921 | /* RelationalOperator: '<S217>/Compare' incorporates: |
| 6922 | * Constant: '<S217>/Constant' |
| 6923 | */ |
| 6924 | L4_MABX_B.Compare_os = (L4_MABX_B.SPN523_TransCurrentGear > |
| 6925 | L4_MABX_P.Constant_Value_f); |
| 6926 | |
| 6927 | /* Logic: '<S209>/Logical Operator1' */ |
| 6928 | L4_MABX_B.f_brk_gov_inactive = !L4_MABX_B.F_Brake_control_active; |
| 6929 | |
| 6930 | /* Logic: '<S209>/Logical Operator' */ |
| 6931 | L4_MABX_B.LogicalOperator_ke = (L4_MABX_B.AutonomousEnabled_d && |
| 6932 | L4_MABX_B.f_brake_sw_off && L4_MABX_B.Compare_ay && L4_MABX_B.Compare_os && |
| 6933 | L4_MABX_B.f_brk_gov_inactive); |
| 6934 | |
| 6935 | /* Outputs for Enabled SubSystem: '<S79>/Throttle_controller_gov' incorporates: |
| 6936 | * EnablePort: '<S212>/Enable' |
| 6937 | */ |
| 6938 | if (L4_MABX_B.LogicalOperator_ke) { |
| 6939 | if (!L4_MABX_DW.Throttle_controller_gov_MODE) { |
| 6940 | /* InitializeConditions for UnitDelay: '<S220>/Unit_Delay1' */ |
| 6941 | L4_MABX_DW.Unit_Delay1_DSTATE_p1 = |
| 6942 | L4_MABX_P.Unit_Delay1_InitialCondition_o; |
| 6943 | |
| 6944 | /* InitializeConditions for UnitDelay: '<S220>/Unit_Delay' */ |
| 6945 | L4_MABX_DW.Unit_Delay_DSTATE_lq = L4_MABX_P.Unit_Delay_InitialCondition_b2; |
| 6946 | |
| 6947 | /* InitializeConditions for UnitDelay: '<S247>/Unit_Delay' */ |
| 6948 | L4_MABX_DW.Unit_Delay_DSTATE_be = L4_MABX_P.Unit_Delay_InitialCondition_lj; |
| 6949 | |
| 6950 | /* InitializeConditions for UnitDelay: '<S267>/Unit_Delay1' */ |
| 6951 | L4_MABX_DW.Unit_Delay1_DSTATE_h = L4_MABX_P.Unit_Delay1_InitialCondition_a; |
| 6952 | |
| 6953 | /* InitializeConditions for UnitDelay: '<S268>/Unit_Delay' */ |
| 6954 | L4_MABX_DW.Unit_Delay_DSTATE_fi = L4_MABX_P.Unit_Delay_InitialCondition_bm; |
| 6955 | |
| 6956 | /* InitializeConditions for UnitDelay: '<S272>/FixPt Unit Delay2' */ |
| 6957 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_gq = |
| 6958 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_a; |
| 6959 | |
| 6960 | /* InitializeConditions for UnitDelay: '<S272>/FixPt Unit Delay1' */ |
| 6961 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_a = |
| 6962 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_o; |
| 6963 | |
| 6964 | /* InitializeConditions for UnitDelay: '<S267>/Unit_Delay2' */ |
| 6965 | L4_MABX_DW.Unit_Delay2_DSTATE_m = L4_MABX_P.Unit_Delay2_InitialCondition_j; |
| 6966 | |
| 6967 | /* InitializeConditions for UnitDelay: '<S222>/Unit_Delay' */ |
| 6968 | L4_MABX_DW.Unit_Delay_DSTATE_fz = L4_MABX_P.Unit_Delay_InitialCondition_kg; |
| 6969 | L4_MABX_DW.Throttle_controller_gov_MODE = true; |
| 6970 | } |
| 6971 | |
| 6972 | /* DataTypeConversion: '<S219>/Data Type Conversion9' */ |
| 6973 | L4_MABX_B.DataTypeConversion9_h = L4_MABX_B.SFunction1_o4_ki; |
| 6974 | |
| 6975 | /* DataTypeConversion: '<S219>/Data Type Conversion1' */ |
| 6976 | L4_MABX_B.DataTypeConversion1_i = L4_MABX_B.SFunction1_o2_dgu; |
| 6977 | |
| 6978 | /* Sum: '<S219>/Add' */ |
| 6979 | L4_MABX_B.Add_di = L4_MABX_B.DataTypeConversion9_h + |
| 6980 | L4_MABX_B.DataTypeConversion1_i; |
| 6981 | |
| 6982 | /* RelationalOperator: '<S224>/Relational Operator1' incorporates: |
| 6983 | * Constant: '<S219>/Constant1' |
| 6984 | */ |
| 6985 | L4_MABX_B.RelationalOperator1_n = (L4_MABX_B.Add_di >= |
| 6986 | L4_MABX_P.Constant1_Value_c); |
| 6987 | |
| 6988 | /* RelationalOperator: '<S224>/Relational Operator' incorporates: |
| 6989 | * Constant: '<S219>/Constant3' |
| 6990 | */ |
| 6991 | L4_MABX_B.RelationalOperator_d3 = (L4_MABX_B.Add_di <= |
| 6992 | L4_MABX_P.Constant3_Value_d); |
| 6993 | |
| 6994 | /* Outputs for Atomic SubSystem: '<S224>/If_Then_Else1' */ |
| 6995 | |
| 6996 | /* Constant: '<S219>/Constant3' */ |
| 6997 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_d3, |
| 6998 | L4_MABX_P.Constant3_Value_d, L4_MABX_B.Add_di, |
| 6999 | &L4_MABX_B.If_Then_Else1_h); |
| 7000 | |
| 7001 | /* End of Outputs for SubSystem: '<S224>/If_Then_Else1' */ |
| 7002 | |
| 7003 | /* Outputs for Atomic SubSystem: '<S224>/If_Then_Else' */ |
| 7004 | |
| 7005 | /* Constant: '<S219>/Constant1' */ |
| 7006 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_n, |
| 7007 | L4_MABX_P.Constant1_Value_c, |
| 7008 | L4_MABX_B.If_Then_Else1_h.Switch, |
| 7009 | &L4_MABX_B.If_Then_Else_ct); |
| 7010 | |
| 7011 | /* End of Outputs for SubSystem: '<S224>/If_Then_Else' */ |
| 7012 | |
| 7013 | /* DataTypeConversion: '<S219>/Data Type Conversion2' */ |
| 7014 | L4_MABX_B.DataTypeConversion2_id = L4_MABX_B.SPN514_NominalFrictionPercentTo; |
| 7015 | |
| 7016 | /* RelationalOperator: '<S225>/Relational Operator1' incorporates: |
| 7017 | * Constant: '<S219>/Constant2' |
| 7018 | */ |
| 7019 | L4_MABX_B.RelationalOperator1_ch = (L4_MABX_B.DataTypeConversion2_id >= |
| 7020 | L4_MABX_P.Constant2_Value_b); |
| 7021 | |
| 7022 | /* RelationalOperator: '<S225>/Relational Operator' incorporates: |
| 7023 | * Constant: '<S219>/Constant4' |
| 7024 | */ |
| 7025 | L4_MABX_B.RelationalOperator_j = (L4_MABX_B.DataTypeConversion2_id <= |
| 7026 | L4_MABX_P.Constant4_Value); |
| 7027 | |
| 7028 | /* Outputs for Atomic SubSystem: '<S225>/If_Then_Else1' */ |
| 7029 | |
| 7030 | /* Constant: '<S219>/Constant4' */ |
| 7031 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_j, |
| 7032 | L4_MABX_P.Constant4_Value, |
| 7033 | L4_MABX_B.DataTypeConversion2_id, |
| 7034 | &L4_MABX_B.If_Then_Else1_kg); |
| 7035 | |
| 7036 | /* End of Outputs for SubSystem: '<S225>/If_Then_Else1' */ |
| 7037 | |
| 7038 | /* Outputs for Atomic SubSystem: '<S225>/If_Then_Else' */ |
| 7039 | |
| 7040 | /* Constant: '<S219>/Constant2' */ |
| 7041 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_ch, |
| 7042 | L4_MABX_P.Constant2_Value_b, |
| 7043 | L4_MABX_B.If_Then_Else1_kg.Switch, |
| 7044 | &L4_MABX_B.If_Then_Else_bo); |
| 7045 | |
| 7046 | /* End of Outputs for SubSystem: '<S225>/If_Then_Else' */ |
| 7047 | |
| 7048 | /* DataTypeConversion: '<S219>/Data Type Conversion3' */ |
| 7049 | L4_MABX_B.DataTypeConversion3_h = L4_MABX_B.SPN2978_EstEngParasiticLossesPe; |
| 7050 | |
| 7051 | /* RelationalOperator: '<S226>/Relational Operator1' incorporates: |
| 7052 | * Constant: '<S219>/Constant5' |
| 7053 | */ |
| 7054 | L4_MABX_B.RelationalOperator1_ln = (L4_MABX_B.DataTypeConversion3_h >= |
| 7055 | L4_MABX_P.Constant5_Value); |
| 7056 | |
| 7057 | /* RelationalOperator: '<S226>/Relational Operator' incorporates: |
| 7058 | * Constant: '<S219>/Constant6' |
| 7059 | */ |
| 7060 | L4_MABX_B.RelationalOperator_fd = (L4_MABX_B.DataTypeConversion3_h <= |
| 7061 | L4_MABX_P.Constant6_Value); |
| 7062 | |
| 7063 | /* Outputs for Atomic SubSystem: '<S226>/If_Then_Else1' */ |
| 7064 | |
| 7065 | /* Constant: '<S219>/Constant6' */ |
| 7066 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_fd, |
| 7067 | L4_MABX_P.Constant6_Value, |
| 7068 | L4_MABX_B.DataTypeConversion3_h, |
| 7069 | &L4_MABX_B.If_Then_Else1_dz); |
| 7070 | |
| 7071 | /* End of Outputs for SubSystem: '<S226>/If_Then_Else1' */ |
| 7072 | |
| 7073 | /* Outputs for Atomic SubSystem: '<S226>/If_Then_Else' */ |
| 7074 | |
| 7075 | /* Constant: '<S219>/Constant5' */ |
| 7076 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_ln, |
| 7077 | L4_MABX_P.Constant5_Value, |
| 7078 | L4_MABX_B.If_Then_Else1_dz.Switch, |
| 7079 | &L4_MABX_B.If_Then_Else_br); |
| 7080 | |
| 7081 | /* End of Outputs for SubSystem: '<S226>/If_Then_Else' */ |
| 7082 | |
| 7083 | /* DataTypeConversion: '<S223>/Data Type Conversion5' */ |
| 7084 | L4_MABX_B.DataTypeConversion5_i = L4_MABX_B.SFunction1_o1_au; |
| 7085 | |
| 7086 | /* Lookup_n-D: '<S230>/1-D Lookup Table' */ |
| 7087 | L4_MABX_B.Coeff_of_drag_Cd = look1_binlcapw(L4_MABX_B.DataTypeConversion5_i, |
| 7088 | L4_MABX_P.uDLookupTable_bp01Data, L4_MABX_P.uDLookupTable_tableData, 2U); |
| 7089 | |
| 7090 | /* Gain: '<S230>/KPH_TO_M//S' */ |
| 7091 | L4_MABX_B.KPH_TO_MS = L4_MABX_P.KPH_TO_MS_Gain * |
| 7092 | L4_MABX_B.DataTypeConversion5_i; |
| 7093 | |
| 7094 | /* Math: '<S230>/Math Function' |
| 7095 | * |
| 7096 | * About '<S230>/Math Function': |
| 7097 | * Operator: magnitude^2 |
| 7098 | */ |
| 7099 | PositionFinalLimited = L4_MABX_B.KPH_TO_MS; |
| 7100 | L4_MABX_B.MathFunction = PositionFinalLimited * PositionFinalLimited; |
| 7101 | |
| 7102 | /* DataTypeConversion: '<S223>/Data Type Conversion' */ |
| 7103 | L4_MABX_B.DataTypeConversion_ik = L4_MABX_B.SFunction1_o1_a5; |
| 7104 | |
| 7105 | /* Gain: '<S230>/KPA_TO_PA' */ |
| 7106 | L4_MABX_B.KPA_TO_PA = L4_MABX_P.KPA_TO_PA_Gain * |
| 7107 | L4_MABX_B.DataTypeConversion_ik; |
| 7108 | |
| 7109 | /* DataTypeConversion: '<S223>/Data Type Conversion4' */ |
| 7110 | L4_MABX_B.DataTypeConversion4_b = L4_MABX_B.SFunction1_o3_fp; |
| 7111 | |
| 7112 | /* Sum: '<S230>/Add' incorporates: |
| 7113 | * Constant: '<S230>/Constant' |
| 7114 | */ |
| 7115 | L4_MABX_B.Add_o = L4_MABX_B.DataTypeConversion4_b + L4_MABX_P.Constant_Value; |
| 7116 | |
| 7117 | /* Product: '<S230>/Product' incorporates: |
| 7118 | * Constant: '<S230>/Constant1' |
| 7119 | */ |
| 7120 | L4_MABX_B.Product_nm = L4_MABX_B.Add_o * L4_MABX_P.Constant1_Value_p; |
| 7121 | |
| 7122 | /* Product: '<S230>/Divide' */ |
| 7123 | L4_MABX_B.Air_density_kgm3 = L4_MABX_B.KPA_TO_PA / L4_MABX_B.Product_nm; |
| 7124 | |
| 7125 | /* Product: '<S230>/Product1' incorporates: |
| 7126 | * Constant: '<S223>/Veh_Frontal_Area_m^2' |
| 7127 | * Constant: '<S230>/Constant2' |
| 7128 | */ |
| 7129 | L4_MABX_B.Aerodynamic_resistance_Ra = L4_MABX_B.Coeff_of_drag_Cd * |
| 7130 | L4_MABX_P.Veh_Frontal_Area_m2_Value * L4_MABX_B.MathFunction * |
| 7131 | L4_MABX_B.Air_density_kgm3 * L4_MABX_P.Constant2_Value_h; |
| 7132 | |
| 7133 | /* DataTypeConversion: '<S223>/Data Type Conversion6' */ |
| 7134 | L4_MABX_B.DataTypeConversion6_f = L4_MABX_B.PitchAngleExRange; |
| 7135 | |
| 7136 | /* Product: '<S231>/Divide' incorporates: |
| 7137 | * Constant: '<S231>/Constant2' |
| 7138 | * Constant: '<S231>/Constant3' |
| 7139 | */ |
| 7140 | L4_MABX_B.grade_angle_radians = L4_MABX_B.DataTypeConversion6_f * |
| 7141 | L4_MABX_P.Constant2_Value_bc / L4_MABX_P.Constant3_Value_n; |
| 7142 | |
| 7143 | /* Trigonometry: '<S231>/Trigonometric Function' */ |
| 7144 | L4_MABX_B.TrigonometricFunction_a = sin(L4_MABX_B.grade_angle_radians); |
| 7145 | |
| 7146 | /* Product: '<S231>/Product1' incorporates: |
| 7147 | * Constant: '<S231>/Constant1' |
| 7148 | */ |
| 7149 | L4_MABX_B.Gradient_resistance_Rg = L4_MABX_B.SPN1760_GrossCombinationVehicle |
| 7150 | * L4_MABX_B.TrigonometricFunction_a * L4_MABX_P.Constant1_Value_a; |
| 7151 | |
| 7152 | /* Gain: '<S234>/KPA_TO_M//S' */ |
| 7153 | L4_MABX_B.KPA_TO_MS = L4_MABX_P.KPA_TO_MS_Gain * |
| 7154 | L4_MABX_B.DataTypeConversion5_i; |
| 7155 | |
| 7156 | /* Product: '<S234>/Divide2' incorporates: |
| 7157 | * Constant: '<S234>/Constant2' |
| 7158 | * Constant: '<S234>/Constant6' |
| 7159 | */ |
| 7160 | L4_MABX_B.Divide2_c = L4_MABX_P.Constant2_Value_bq * L4_MABX_B.KPA_TO_MS / |
| 7161 | L4_MABX_P.Constant6_Value_g; |
| 7162 | |
| 7163 | /* Math: '<S234>/Math Function' |
| 7164 | * |
| 7165 | * About '<S234>/Math Function': |
| 7166 | * Operator: magnitude^2 |
| 7167 | */ |
| 7168 | PositionFinalLimited = L4_MABX_B.Divide2_c; |
| 7169 | L4_MABX_B.MathFunction_l = PositionFinalLimited * PositionFinalLimited; |
| 7170 | |
| 7171 | /* Sum: '<S234>/Add' incorporates: |
| 7172 | * Constant: '<S234>/Constant1' |
| 7173 | */ |
| 7174 | L4_MABX_B.Add_nj = L4_MABX_P.Constant1_Value_m + L4_MABX_B.MathFunction_l; |
| 7175 | |
| 7176 | /* Outputs for Atomic SubSystem: '<S228>/If_Then_Else' */ |
| 7177 | |
| 7178 | /* Constant: '<S223>/TIRE1_tire_pressure' incorporates: |
| 7179 | * Constant: '<S228>/Truck166_tire_pressure' |
| 7180 | */ |
| 7181 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_c, |
| 7182 | L4_MABX_P.TIRE1_tire_pressure_Value, |
| 7183 | L4_MABX_P.Truck166_tire_pressure_Value, |
| 7184 | &L4_MABX_B.If_Then_Else_nr); |
| 7185 | |
| 7186 | /* End of Outputs for SubSystem: '<S228>/If_Then_Else' */ |
| 7187 | |
| 7188 | /* Gain: '<S234>/KPA_TO_BAR' */ |
| 7189 | L4_MABX_B.KPA_TO_BAR = L4_MABX_P.KPA_TO_BAR_Gain * |
| 7190 | L4_MABX_B.If_Then_Else_nr.Switch; |
| 7191 | |
| 7192 | /* Product: '<S234>/Divide' */ |
| 7193 | L4_MABX_B.Divide_k = L4_MABX_B.Add_nj / L4_MABX_B.KPA_TO_BAR; |
| 7194 | |
| 7195 | /* Sum: '<S234>/Add1' incorporates: |
| 7196 | * Constant: '<S234>/Constant' |
| 7197 | */ |
| 7198 | L4_MABX_B.Coeff_of_rolling_resistance_Cr = L4_MABX_P.Constant_Value_h + |
| 7199 | L4_MABX_B.Divide_k; |
| 7200 | |
| 7201 | /* Product: '<S232>/Divide1' incorporates: |
| 7202 | * Constant: '<S232>/Constant4' |
| 7203 | * Constant: '<S232>/Constant5' |
| 7204 | */ |
| 7205 | L4_MABX_B.grade_angle_radians_a = L4_MABX_B.DataTypeConversion6_f * |
| 7206 | L4_MABX_P.Constant4_Value_o / L4_MABX_P.Constant5_Value_p; |
| 7207 | |
| 7208 | /* Trigonometry: '<S232>/Trigonometric Function' */ |
| 7209 | L4_MABX_B.TrigonometricFunction_e = cos(L4_MABX_B.grade_angle_radians_a); |
| 7210 | |
| 7211 | /* Product: '<S232>/Product2' incorporates: |
| 7212 | * Constant: '<S232>/Constant3' |
| 7213 | */ |
| 7214 | L4_MABX_B.Rolling_resistance_Rr = L4_MABX_B.Coeff_of_rolling_resistance_Cr * |
| 7215 | L4_MABX_B.SPN1760_GrossCombinationVehicle * |
| 7216 | L4_MABX_B.TrigonometricFunction_e * L4_MABX_P.Constant3_Value_p; |
| 7217 | |
| 7218 | /* Sum: '<S228>/Add' incorporates: |
| 7219 | * Constant: '<S228>/Constant' |
| 7220 | */ |
| 7221 | L4_MABX_B.TotalTractiveForce_N = ((L4_MABX_B.Aerodynamic_resistance_Ra + |
| 7222 | L4_MABX_B.Gradient_resistance_Rg) + L4_MABX_B.Rolling_resistance_Rr) + |
| 7223 | L4_MABX_P.Constant_Value_g; |
| 7224 | |
| 7225 | /* Saturate: '<S223>/Saturation' */ |
| 7226 | DeltaTime = L4_MABX_B.SPN526_TransActualGearRatio; |
| 7227 | Time56 = L4_MABX_P.Saturation_LowerSat_p; |
| 7228 | AccelerationAverage = L4_MABX_P.Saturation_UpperSat_n; |
| 7229 | if (DeltaTime > AccelerationAverage) { |
| 7230 | L4_MABX_B.Saturation_g = AccelerationAverage; |
| 7231 | } else if (DeltaTime < Time56) { |
| 7232 | L4_MABX_B.Saturation_g = Time56; |
| 7233 | } else { |
| 7234 | L4_MABX_B.Saturation_g = DeltaTime; |
| 7235 | } |
| 7236 | |
| 7237 | /* End of Saturate: '<S223>/Saturation' */ |
| 7238 | |
| 7239 | /* MATLAB Function: '<S223>/F_wheel_to_Tq_eng' incorporates: |
| 7240 | * Constant: '<S223>/N_rar' |
| 7241 | * Constant: '<S223>/R_wheel_m' |
| 7242 | * Constant: '<S223>/eta' |
| 7243 | */ |
| 7244 | /* MATLAB Function 'STATE_CONTROL_10ms/Throttle_controller_gov/Determine_engine_torque_and_losses/CalculateRoadLoadTorque/F_wheel_to_Tq_eng': '<S229>:1' */ |
| 7245 | /* '<S229>:1:3' */ |
| 7246 | L4_MABX_B.road_load_tq = L4_MABX_B.TotalTractiveForce_N * |
| 7247 | L4_MABX_P.R_wheel_m_Value / L4_MABX_P.N_rar_Value / L4_MABX_B.Saturation_g |
| 7248 | / L4_MABX_P.eta_Value; |
| 7249 | |
| 7250 | /* DataTypeConversion: '<S223>/Data Type Conversion1' */ |
| 7251 | L4_MABX_B.DataTypeConversion1_b = L4_MABX_B.SPN544_EngineReferenceTorque; |
| 7252 | |
| 7253 | /* Product: '<S223>/Divide' */ |
| 7254 | L4_MABX_B.RoadLoadTorque_fract = L4_MABX_B.road_load_tq / |
| 7255 | L4_MABX_B.DataTypeConversion1_b; |
| 7256 | |
| 7257 | /* Gain: '<S223>/Gain' */ |
| 7258 | L4_MABX_B.RoadLoadTorque_pct = L4_MABX_P.Gain_Gain_n * |
| 7259 | L4_MABX_B.RoadLoadTorque_fract; |
| 7260 | |
| 7261 | /* Outputs for Atomic SubSystem: '<S219>/If_Then_Else' */ |
| 7262 | |
| 7263 | /* Constant: '<S219>/UseFeedForwardRoadLoad' incorporates: |
| 7264 | * Constant: '<S219>/ZeroRoadLoadCPV' |
| 7265 | */ |
| 7266 | L4_MABX_If_Then_Else(L4_MABX_P.UseFeedForwardRoadLoad_Value, |
| 7267 | L4_MABX_B.RoadLoadTorque_pct, |
| 7268 | L4_MABX_P.ZeroRoadLoadCPV_Value, |
| 7269 | &L4_MABX_B.If_Then_Else_as); |
| 7270 | |
| 7271 | /* End of Outputs for SubSystem: '<S219>/If_Then_Else' */ |
| 7272 | |
| 7273 | /* Sum: '<S219>/Add1' */ |
| 7274 | L4_MABX_B.FeedForwardTorque_pct = (L4_MABX_B.If_Then_Else_bo.Switch + |
| 7275 | L4_MABX_B.If_Then_Else_br.Switch) + L4_MABX_B.If_Then_Else_as.Switch; |
| 7276 | |
| 7277 | /* UnitDelay: '<S220>/Unit_Delay1' */ |
| 7278 | L4_MABX_B.Unit_Delay1_m = L4_MABX_DW.Unit_Delay1_DSTATE_p1; |
| 7279 | |
| 7280 | /* Logic: '<S220>/Logical Operator' incorporates: |
| 7281 | * Constant: '<S220>/Constant1' |
| 7282 | */ |
| 7283 | L4_MABX_B.f_gpid_reset = (L4_MABX_P.Constant1_Value_g1 || |
| 7284 | L4_MABX_B.Unit_Delay1_m); |
| 7285 | |
| 7286 | /* Sum: '<S220>/Subtract' */ |
| 7287 | L4_MABX_B.Subtract_f = L4_MABX_B.VSPD_TARGET_KPH_APV_g - |
| 7288 | L4_MABX_B.VSPD_HYST_KPH_APV_f; |
| 7289 | |
| 7290 | /* RelationalOperator: '<S220>/Relational Operator' */ |
| 7291 | L4_MABX_B.RelationalOperator_fl = (L4_MABX_B.DataTypeConversion4_ib > |
| 7292 | L4_MABX_B.Subtract_f); |
| 7293 | |
| 7294 | /* UnitDelay: '<S220>/Unit_Delay' */ |
| 7295 | L4_MABX_B.Unit_Delay_d5 = L4_MABX_DW.Unit_Delay_DSTATE_lq; |
| 7296 | |
| 7297 | /* RelationalOperator: '<S220>/Relational Operator1' */ |
| 7298 | L4_MABX_B.RelationalOperator1_d3 = (L4_MABX_B.RelationalOperator_fl != |
| 7299 | L4_MABX_B.Unit_Delay_d5); |
| 7300 | |
| 7301 | /* Lookup_n-D: '<S241>/2D_Lookup_Table' */ |
| 7302 | L4_MABX_B.uD_Lookup_Table_am = look2_binlcapw |
| 7303 | (L4_MABX_B.SPN1760_GrossCombinationVehicle, |
| 7304 | L4_MABX_B.SPN526_TransActualGearRatio, TQ_DEM_MASS_STEP_MPV, |
| 7305 | TQ_DEM_GEAR_RATIO_STEP_MPV, TQ_DEM_KP_DATA_MPV, |
| 7306 | L4_MABX_P.uD_Lookup_Table_maxIndex, 8U); |
| 7307 | |
| 7308 | /* Lookup_n-D: '<S242>/2D_Lookup_Table' */ |
| 7309 | L4_MABX_B.uD_Lookup_Table_o = look2_binlcapw |
| 7310 | (L4_MABX_B.SPN1760_GrossCombinationVehicle, |
| 7311 | L4_MABX_B.SPN526_TransActualGearRatio, TQ_DEM_MASS_STEP_MPV, |
| 7312 | TQ_DEM_GEAR_RATIO_STEP_MPV, TQ_DEM_KI_DATA_MPV, |
| 7313 | L4_MABX_P.uD_Lookup_Table_maxIndex_p, 8U); |
| 7314 | |
| 7315 | /* Lookup_n-D: '<S243>/2D_Lookup_Table' */ |
| 7316 | L4_MABX_B.uD_Lookup_Table_h = look2_binlcapw |
| 7317 | (L4_MABX_B.SPN1760_GrossCombinationVehicle, |
| 7318 | L4_MABX_B.SPN526_TransActualGearRatio, TQ_DEM_MASS_STEP_MPV, |
| 7319 | TQ_DEM_GEAR_RATIO_STEP_MPV, TQ_DEM_KD_DATA_MPV, |
| 7320 | L4_MABX_P.uD_Lookup_Table_maxIndex_a, 8U); |
| 7321 | |
| 7322 | /* Abs: '<S244>/Abs' */ |
| 7323 | L4_MABX_B.Abs_igm = fabs(L4_MABX_B.uD_Lookup_Table_o); |
| 7324 | |
| 7325 | /* Abs: '<S244>/Abs1' */ |
| 7326 | L4_MABX_B.Abs1_a = fabs(L4_MABX_B.uD_Lookup_Table_h); |
| 7327 | |
| 7328 | /* UnitDelay: '<S247>/Unit_Delay' */ |
| 7329 | L4_MABX_B.Unit_Delay_i0 = L4_MABX_DW.Unit_Delay_DSTATE_be; |
| 7330 | |
| 7331 | /* Logic: '<S247>/Logical Operator1' */ |
| 7332 | L4_MABX_B.LogicalOperator1_o = (L4_MABX_B.Unit_Delay_i0 || |
| 7333 | L4_MABX_B.f_gpid_reset); |
| 7334 | |
| 7335 | /* UnitDelay: '<S267>/Unit_Delay1' */ |
| 7336 | L4_MABX_B.Unit_Delay1_dw = L4_MABX_DW.Unit_Delay1_DSTATE_h; |
| 7337 | |
| 7338 | /* Logic: '<S267>/Logical Operator' */ |
| 7339 | L4_MABX_B.LogicalOperator_at = (L4_MABX_B.LogicalOperator1_o || |
| 7340 | L4_MABX_B.Unit_Delay1_dw); |
| 7341 | |
| 7342 | /* UnitDelay: '<S268>/Unit_Delay' */ |
| 7343 | L4_MABX_B.Unit_Delay_ne = L4_MABX_DW.Unit_Delay_DSTATE_fi; |
| 7344 | |
| 7345 | /* Logic: '<S268>/Logical Operator1' */ |
| 7346 | L4_MABX_B.LogicalOperator1_kz = (L4_MABX_B.LogicalOperator1_o || |
| 7347 | L4_MABX_B.Unit_Delay_ne); |
| 7348 | |
| 7349 | /* UnitDelay: '<S272>/FixPt Unit Delay2' */ |
| 7350 | L4_MABX_B.FixPtUnitDelay2_a = L4_MABX_DW.FixPtUnitDelay2_DSTATE_gq; |
| 7351 | |
| 7352 | /* UnitDelay: '<S272>/FixPt Unit Delay1' */ |
| 7353 | L4_MABX_B.Xold_a = L4_MABX_DW.FixPtUnitDelay1_DSTATE_a; |
| 7354 | |
| 7355 | /* Switch: '<S272>/Init' */ |
| 7356 | if (L4_MABX_B.FixPtUnitDelay2_a != 0) { |
| 7357 | L4_MABX_B.Init_pu = L4_MABX_B.VSPD_TARGET_KPH_APV_g; |
| 7358 | } else { |
| 7359 | L4_MABX_B.Init_pu = L4_MABX_B.Xold_a; |
| 7360 | } |
| 7361 | |
| 7362 | /* End of Switch: '<S272>/Init' */ |
| 7363 | |
| 7364 | /* Abs: '<S268>/Abs' incorporates: |
| 7365 | * Constant: '<S212>/TqDemSlewInc' |
| 7366 | */ |
| 7367 | L4_MABX_B.Abs_n = fabs(L4_MABX_P.TqDemSlewInc_Value); |
| 7368 | |
| 7369 | /* Product: '<S268>/Product1' incorporates: |
| 7370 | * Constant: '<S212>/TqDemDt' |
| 7371 | */ |
| 7372 | L4_MABX_B.Product1_g = L4_MABX_B.Abs_n * L4_MABX_P.TqDemDt_Value; |
| 7373 | |
| 7374 | /* Sum: '<S268>/Add1' */ |
| 7375 | L4_MABX_B.Add1_g = L4_MABX_B.Init_pu + L4_MABX_B.Product1_g; |
| 7376 | |
| 7377 | /* MinMax: '<S268>/MinMax2' */ |
| 7378 | DeltaTime = L4_MABX_B.VSPD_TARGET_KPH_APV_g; |
| 7379 | PositionFinalLimited = L4_MABX_B.Add1_g; |
| 7380 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 7381 | PositionFinalLimited = DeltaTime; |
| 7382 | } |
| 7383 | |
| 7384 | L4_MABX_B.MinMax2_n = PositionFinalLimited; |
| 7385 | |
| 7386 | /* End of MinMax: '<S268>/MinMax2' */ |
| 7387 | |
| 7388 | /* Abs: '<S268>/Abs1' incorporates: |
| 7389 | * Constant: '<S212>/TqDemSlewDec' |
| 7390 | */ |
| 7391 | L4_MABX_B.Abs1_d = fabs(L4_MABX_P.TqDemSlewDec_Value); |
| 7392 | |
| 7393 | /* Product: '<S268>/Product2' incorporates: |
| 7394 | * Constant: '<S212>/TqDemDt' |
| 7395 | */ |
| 7396 | L4_MABX_B.Product2_bn = L4_MABX_P.TqDemDt_Value * L4_MABX_B.Abs1_d; |
| 7397 | |
| 7398 | /* Sum: '<S268>/Subtract1' */ |
| 7399 | L4_MABX_B.Subtract1_o = L4_MABX_B.Init_pu - L4_MABX_B.Product2_bn; |
| 7400 | |
| 7401 | /* MinMax: '<S268>/MinMax1' */ |
| 7402 | DeltaTime = L4_MABX_B.MinMax2_n; |
| 7403 | PositionFinalLimited = L4_MABX_B.Subtract1_o; |
| 7404 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 7405 | PositionFinalLimited = DeltaTime; |
| 7406 | } |
| 7407 | |
| 7408 | L4_MABX_B.MinMax1_g = PositionFinalLimited; |
| 7409 | |
| 7410 | /* End of MinMax: '<S268>/MinMax1' */ |
| 7411 | |
| 7412 | /* Outputs for Atomic SubSystem: '<S268>/If_Then_Else' */ |
| 7413 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_kz, |
| 7414 | L4_MABX_B.DataTypeConversion4_ib, L4_MABX_B.MinMax1_g, |
| 7415 | &L4_MABX_B.If_Then_Else_cp); |
| 7416 | |
| 7417 | /* End of Outputs for SubSystem: '<S268>/If_Then_Else' */ |
| 7418 | |
| 7419 | /* Sum: '<S245>/Subtract' */ |
| 7420 | L4_MABX_B.Subtract_jb = L4_MABX_B.If_Then_Else_cp.Switch - |
| 7421 | L4_MABX_B.DataTypeConversion4_ib; |
| 7422 | |
| 7423 | /* MinMax: '<S267>/MinMax1' incorporates: |
| 7424 | * Constant: '<S212>/TqDemDt' |
| 7425 | * Constant: '<S212>/TqDemTFildCtrlErrorSecs' |
| 7426 | */ |
| 7427 | DeltaTime = L4_MABX_P.TqDemDt_Value; |
| 7428 | PositionFinalLimited = L4_MABX_P.TqDemTFildCtrlErrorSecs_Value; |
| 7429 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 7430 | PositionFinalLimited = DeltaTime; |
| 7431 | } |
| 7432 | |
| 7433 | L4_MABX_B.MinMax1_d = PositionFinalLimited; |
| 7434 | |
| 7435 | /* End of MinMax: '<S267>/MinMax1' */ |
| 7436 | |
| 7437 | /* Saturate: '<S267>/Saturation' */ |
| 7438 | DeltaTime = L4_MABX_B.MinMax1_d; |
| 7439 | Time56 = L4_MABX_P.Saturation_LowerSat_g5; |
| 7440 | AccelerationAverage = L4_MABX_P.Saturation_UpperSat_f; |
| 7441 | if (DeltaTime > AccelerationAverage) { |
| 7442 | L4_MABX_B.Saturation_d = AccelerationAverage; |
| 7443 | } else if (DeltaTime < Time56) { |
| 7444 | L4_MABX_B.Saturation_d = Time56; |
| 7445 | } else { |
| 7446 | L4_MABX_B.Saturation_d = DeltaTime; |
| 7447 | } |
| 7448 | |
| 7449 | /* End of Saturate: '<S267>/Saturation' */ |
| 7450 | |
| 7451 | /* Product: '<S267>/Divide' incorporates: |
| 7452 | * Constant: '<S212>/TqDemDt' |
| 7453 | */ |
| 7454 | L4_MABX_B.Divide_n = L4_MABX_P.TqDemDt_Value / L4_MABX_B.Saturation_d; |
| 7455 | |
| 7456 | /* Product: '<S267>/Product2' */ |
| 7457 | L4_MABX_B.Product2_l = L4_MABX_B.Subtract_jb * L4_MABX_B.Divide_n; |
| 7458 | |
| 7459 | /* Sum: '<S267>/Subtract1' incorporates: |
| 7460 | * Constant: '<S267>/Constant1' |
| 7461 | */ |
| 7462 | L4_MABX_B.Subtract1_k = L4_MABX_P.Constant1_Value_ci - L4_MABX_B.Divide_n; |
| 7463 | |
| 7464 | /* UnitDelay: '<S267>/Unit_Delay2' */ |
| 7465 | L4_MABX_B.Unit_Delay2_o = L4_MABX_DW.Unit_Delay2_DSTATE_m; |
| 7466 | |
| 7467 | /* Product: '<S267>/Product1' */ |
| 7468 | L4_MABX_B.Product1_p = L4_MABX_B.Subtract1_k * L4_MABX_B.Unit_Delay2_o; |
| 7469 | |
| 7470 | /* Sum: '<S267>/Add1' */ |
| 7471 | L4_MABX_B.Add1_i = L4_MABX_B.Product2_l + L4_MABX_B.Product1_p; |
| 7472 | |
| 7473 | /* Outputs for Atomic SubSystem: '<S267>/If_Then_Else' */ |
| 7474 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_at, L4_MABX_B.Subtract_jb, |
| 7475 | L4_MABX_B.Add1_i, &L4_MABX_B.If_Then_Else_k2); |
| 7476 | |
| 7477 | /* End of Outputs for SubSystem: '<S267>/If_Then_Else' */ |
| 7478 | |
| 7479 | /* RelationalOperator: '<S252>/Compare' incorporates: |
| 7480 | * Constant: '<S252>/Constant' |
| 7481 | */ |
| 7482 | L4_MABX_B.Compare_go = (L4_MABX_B.Abs1_a > |
| 7483 | L4_MABX_P.CompareToConstant1_const_i); |
| 7484 | |
| 7485 | /* Outputs for Enabled SubSystem: '<S244>/Calculate_D_term' */ |
| 7486 | |
| 7487 | /* Constant: '<S212>/TqDemDt' incorporates: |
| 7488 | * Constant: '<S212>/TqDemTFildTSecs' |
| 7489 | */ |
| 7490 | L4_MABX_Calculate_D_term(L4_MABX_B.Compare_go, L4_MABX_B.uD_Lookup_Table_h, |
| 7491 | L4_MABX_P.TqDemDt_Value, L4_MABX_B.LogicalOperator1_o, |
| 7492 | L4_MABX_B.If_Then_Else_k2.Switch, L4_MABX_P.TqDemTFildTSecs_Value, |
| 7493 | &L4_MABX_B.Calculate_D_term_h, &L4_MABX_DW.Calculate_D_term_h, |
| 7494 | &L4_MABX_P.Calculate_D_term_h); |
| 7495 | |
| 7496 | /* End of Outputs for SubSystem: '<S244>/Calculate_D_term' */ |
| 7497 | |
| 7498 | /* Product: '<S250>/Product' */ |
| 7499 | L4_MABX_B.Product_i = L4_MABX_B.uD_Lookup_Table_am * |
| 7500 | L4_MABX_B.If_Then_Else_k2.Switch; |
| 7501 | |
| 7502 | /* RelationalOperator: '<S212>/Relational Operator' */ |
| 7503 | L4_MABX_B.RelationalOperator_a = (L4_MABX_B.SPN524_TransSelectedGear != |
| 7504 | L4_MABX_B.SPN523_TransCurrentGear); |
| 7505 | |
| 7506 | /* UnitDelay: '<S222>/Unit_Delay' */ |
| 7507 | L4_MABX_B.Unit_Delay_m4 = L4_MABX_DW.Unit_Delay_DSTATE_fz; |
| 7508 | |
| 7509 | /* RelationalOperator: '<S251>/Compare' incorporates: |
| 7510 | * Constant: '<S251>/Constant' |
| 7511 | */ |
| 7512 | L4_MABX_B.Compare_pj = (L4_MABX_B.Abs_igm > |
| 7513 | L4_MABX_P.CompareToConstant_const_d); |
| 7514 | |
| 7515 | /* Outputs for Enabled SubSystem: '<S244>/Calculate_I_term' */ |
| 7516 | |
| 7517 | /* Constant: '<S212>/TqDemDt' incorporates: |
| 7518 | * Constant: '<S212>/GpidAwCondIntegration' |
| 7519 | * Constant: '<S212>/TqDemAwHyst' |
| 7520 | */ |
| 7521 | L4_MABX_Calculate_I_term(L4_MABX_B.Compare_pj, L4_MABX_B.Product_i, |
| 7522 | L4_MABX_B.uD_Lookup_Table_o, L4_MABX_B.If_Then_Else_ct.Switch, |
| 7523 | L4_MABX_B.If_Then_Else_k2.Switch, L4_MABX_B.LogicalOperator1_o, |
| 7524 | L4_MABX_P.TqDemDt_Value, L4_MABX_B.FeedForwardTorque_pct, |
| 7525 | L4_MABX_P.GpidAwCondIntegration_Value, L4_MABX_P.TqDemAwHyst_Value, |
| 7526 | L4_MABX_B.RelationalOperator_a, L4_MABX_B.Unit_Delay_m4, |
| 7527 | &L4_MABX_B.Calculate_I_term_n, &L4_MABX_DW.Calculate_I_term_n, |
| 7528 | &L4_MABX_P.Calculate_I_term_n); |
| 7529 | |
| 7530 | /* End of Outputs for SubSystem: '<S244>/Calculate_I_term' */ |
| 7531 | |
| 7532 | /* RelationalOperator: '<S270>/min_relop' incorporates: |
| 7533 | * Constant: '<S212>/TqDemSlewInc' |
| 7534 | * Constant: '<S270>/min_val' |
| 7535 | */ |
| 7536 | L4_MABX_B.min_relop_cbm = (L4_MABX_P.CheckStaticLowerBound_min_b <= |
| 7537 | L4_MABX_P.TqDemSlewInc_Value); |
| 7538 | |
| 7539 | /* Assertion: '<S270>/Assertion' */ |
| 7540 | utAssert(L4_MABX_B.min_relop_cbm); |
| 7541 | |
| 7542 | /* Sum: '<S246>/Add' */ |
| 7543 | L4_MABX_B.Add_ds = ((L4_MABX_B.Product_i + |
| 7544 | L4_MABX_B.Calculate_I_term_n.If_Then_Else.Switch) + |
| 7545 | L4_MABX_B.Calculate_D_term_h.Subtract) + |
| 7546 | L4_MABX_B.FeedForwardTorque_pct; |
| 7547 | |
| 7548 | /* RelationalOperator: '<S273>/Relational Operator1' incorporates: |
| 7549 | * Constant: '<S212>/TqDemLimMax' |
| 7550 | */ |
| 7551 | L4_MABX_B.RelationalOperator1_j = (L4_MABX_B.Add_ds >= |
| 7552 | L4_MABX_P.TqDemLimMax_Value); |
| 7553 | |
| 7554 | /* RelationalOperator: '<S273>/Relational Operator' incorporates: |
| 7555 | * Constant: '<S212>/TqDemLimMin' |
| 7556 | */ |
| 7557 | L4_MABX_B.RelationalOperator_p = (L4_MABX_B.Add_ds <= |
| 7558 | L4_MABX_P.TqDemLimMin_Value); |
| 7559 | |
| 7560 | /* Outputs for Atomic SubSystem: '<S273>/If_Then_Else1' */ |
| 7561 | |
| 7562 | /* Constant: '<S212>/TqDemLimMin' */ |
| 7563 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_p, |
| 7564 | L4_MABX_P.TqDemLimMin_Value, L4_MABX_B.Add_ds, |
| 7565 | &L4_MABX_B.If_Then_Else1_h3); |
| 7566 | |
| 7567 | /* End of Outputs for SubSystem: '<S273>/If_Then_Else1' */ |
| 7568 | |
| 7569 | /* Outputs for Atomic SubSystem: '<S273>/If_Then_Else' */ |
| 7570 | |
| 7571 | /* Constant: '<S212>/TqDemLimMax' */ |
| 7572 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_j, |
| 7573 | L4_MABX_P.TqDemLimMax_Value, |
| 7574 | L4_MABX_B.If_Then_Else1_h3.Switch, |
| 7575 | &L4_MABX_B.If_Then_Else_pi); |
| 7576 | |
| 7577 | /* End of Outputs for SubSystem: '<S273>/If_Then_Else' */ |
| 7578 | |
| 7579 | /* SignalConversion: '<S212>/OutportBufferForPID_d_term' */ |
| 7580 | L4_MABX_B.PID_d_term_c = L4_MABX_B.Calculate_D_term_h.Subtract; |
| 7581 | |
| 7582 | /* SignalConversion: '<S212>/OutportBufferForPID_hold_i_term_f' */ |
| 7583 | L4_MABX_B.PID_hold_i_term_f_b = |
| 7584 | L4_MABX_B.Calculate_I_term_n.LogicalOperator2; |
| 7585 | |
| 7586 | /* SignalConversion: '<S212>/OutportBufferForPID_i_term' */ |
| 7587 | L4_MABX_B.PID_i_term_c = L4_MABX_B.Calculate_I_term_n.If_Then_Else.Switch; |
| 7588 | } else { |
| 7589 | if (L4_MABX_DW.Throttle_controller_gov_MODE) { |
| 7590 | /* Disable for Enabled SubSystem: '<S244>/Calculate_D_term' */ |
| 7591 | if (L4_MABX_DW.Calculate_D_term_h.Calculate_D_term_MODE) { |
| 7592 | L4_Calculate_D_term_Disable(&L4_MABX_B.Calculate_D_term_h, |
| 7593 | &L4_MABX_DW.Calculate_D_term_h, &L4_MABX_P.Calculate_D_term_h); |
| 7594 | } |
| 7595 | |
| 7596 | /* End of Disable for SubSystem: '<S244>/Calculate_D_term' */ |
| 7597 | |
| 7598 | /* Disable for Enabled SubSystem: '<S244>/Calculate_I_term' */ |
| 7599 | if (L4_MABX_DW.Calculate_I_term_n.Calculate_I_term_MODE) { |
| 7600 | L4_Calculate_I_term_Disable(&L4_MABX_B.Calculate_I_term_n, |
| 7601 | &L4_MABX_DW.Calculate_I_term_n, &L4_MABX_P.Calculate_I_term_n); |
| 7602 | } |
| 7603 | |
| 7604 | /* End of Disable for SubSystem: '<S244>/Calculate_I_term' */ |
| 7605 | |
| 7606 | /* Disable for Outport: '<S212>/PID_output' */ |
| 7607 | L4_MABX_B.If_Then_Else_pi.Switch = L4_MABX_P.PID_output_Y0_c; |
| 7608 | |
| 7609 | /* Disable for Outport: '<S212>/PID_output_unlim' */ |
| 7610 | L4_MABX_B.Add_ds = L4_MABX_P.PID_output_unlim_Y0; |
| 7611 | |
| 7612 | /* Disable for Outport: '<S212>/PID_control_error' */ |
| 7613 | L4_MABX_B.If_Then_Else_k2.Switch = L4_MABX_P.PID_control_error_Y0; |
| 7614 | |
| 7615 | /* Disable for Outport: '<S212>/PID_p_term' */ |
| 7616 | L4_MABX_B.Product_i = L4_MABX_P.PID_p_term_Y0; |
| 7617 | |
| 7618 | /* Disable for Outport: '<S212>/PID_i_term' */ |
| 7619 | L4_MABX_B.PID_i_term_c = L4_MABX_P.PID_i_term_Y0; |
| 7620 | |
| 7621 | /* Disable for Outport: '<S212>/PID_d_term' */ |
| 7622 | L4_MABX_B.PID_d_term_c = L4_MABX_P.PID_d_term_Y0; |
| 7623 | |
| 7624 | /* Disable for Outport: '<S212>/PID_hold_i_term_f' */ |
| 7625 | L4_MABX_B.PID_hold_i_term_f_b = L4_MABX_P.PID_hold_i_term_f_Y0; |
| 7626 | L4_MABX_DW.Throttle_controller_gov_MODE = false; |
| 7627 | } |
| 7628 | } |
| 7629 | |
| 7630 | /* End of Outputs for SubSystem: '<S79>/Throttle_controller_gov' */ |
| 7631 | |
| 7632 | /* Switch: '<S79>/Switch' incorporates: |
| 7633 | * Constant: '<S79>/Constant3' |
| 7634 | */ |
| 7635 | if (L4_MABX_B.F_Brake_control_active) { |
| 7636 | L4_MABX_B.ThrottlePID_Y_m = L4_MABX_P.Constant3_Value; |
| 7637 | } else { |
| 7638 | /* DataTypeConversion: '<S79>/Data Type Conversion3' */ |
| 7639 | L4_MABX_B.DataTypeConversion3_m = L4_MABX_B.SPN544_EngineReferenceTorque; |
| 7640 | |
| 7641 | /* Product: '<S79>/Product' incorporates: |
| 7642 | * Constant: '<S79>/Constant2' |
| 7643 | */ |
| 7644 | L4_MABX_B.ThrottlePID_Y_c = L4_MABX_B.If_Then_Else_pi.Switch * |
| 7645 | L4_MABX_B.DataTypeConversion3_m * L4_MABX_P.Constant2_Value; |
| 7646 | L4_MABX_B.ThrottlePID_Y_m = L4_MABX_B.ThrottlePID_Y_c; |
| 7647 | } |
| 7648 | |
| 7649 | /* End of Switch: '<S79>/Switch' */ |
| 7650 | |
| 7651 | /* MultiPortSwitch: '<S83>/Multiport Switch' incorporates: |
| 7652 | * Constant: '<S83>/APTC_DISABLED_PEDAL_POSITION_APV' |
| 7653 | * Constant: '<S83>/APTC_PEDAL_POS_SIG_SOURCE_APV' |
| 7654 | */ |
| 7655 | switch (L4_MABX_P.APTC_PEDAL_POS_SIG_SOURCE_APV_V) { |
| 7656 | case ENUM_PEDAL_POS_SIGNAL_SOURCE_T_DISABLED: |
| 7657 | L4_MABX_B.MultiportSwitch = L4_MABX_P.APTC_DISABLED_PEDAL_POSITION_AP; |
| 7658 | break; |
| 7659 | |
| 7660 | case ENUM_PEDAL_POS_SIGNAL_SOURCE_T_CAN_EEC2_00: |
| 7661 | L4_MABX_B.MultiportSwitch = L4_MABX_B.uDLookupTable; |
| 7662 | break; |
| 7663 | |
| 7664 | case ENUM_PEDAL_POS_SIGNAL_SOURCE_T_SW_EMULATION: |
| 7665 | L4_MABX_B.MultiportSwitch = L4_MABX_B.ThrottlePID_Y_m; |
| 7666 | break; |
| 7667 | |
| 7668 | case ENUM_PEDAL_POS_SIGNAL_SOURCE_T_CAN_EEC2_00_AND_SW_EMULATION: |
| 7669 | /* MinMax: '<S83>/MinMax' */ |
| 7670 | DeltaTime = L4_MABX_B.uDLookupTable; |
| 7671 | PositionFinalLimited = L4_MABX_B.ThrottlePID_Y_m; |
| 7672 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 7673 | PositionFinalLimited = DeltaTime; |
| 7674 | } |
| 7675 | |
| 7676 | L4_MABX_B.MinMax_p = PositionFinalLimited; |
| 7677 | |
| 7678 | /* End of MinMax: '<S83>/MinMax' */ |
| 7679 | L4_MABX_B.MultiportSwitch = L4_MABX_B.MinMax_p; |
| 7680 | break; |
| 7681 | |
| 7682 | default: |
| 7683 | L4_MABX_B.MultiportSwitch = L4_MABX_P.APTC_DISABLED_PEDAL_POSITION_AP; |
| 7684 | break; |
| 7685 | } |
| 7686 | |
| 7687 | /* End of MultiPortSwitch: '<S83>/Multiport Switch' */ |
| 7688 | |
| 7689 | /* Outputs for Atomic SubSystem: '<S83>/If_Then_Else1' */ |
| 7690 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_d, L4_MABX_B.uDLookupTable, |
| 7691 | L4_MABX_B.MultiportSwitch, &L4_MABX_B.If_Then_Else1_lw); |
| 7692 | |
| 7693 | /* End of Outputs for SubSystem: '<S83>/If_Then_Else1' */ |
| 7694 | |
| 7695 | /* DataTypeConversion: '<S82>/Data Type Conversion1' */ |
| 7696 | L4_MABX_B.DataTypeConversion1_n = L4_MABX_B.SFunction1_o5_nl; |
| 7697 | |
| 7698 | /* Lookup_n-D: '<S85>/2D_Lookup_Table' */ |
| 7699 | L4_MABX_B.uD_Lookup_Table = look2_binlcapw(L4_MABX_B.If_Then_Else1_lw.Switch, |
| 7700 | L4_MABX_B.DataTypeConversion1_n, APTC_TRQ_PED_INV_MAP_TRQ_STEPS, |
| 7701 | APTC_TRQ_PED_TRQ_ESPD_STEP_MPV, APTC_TRQ_PED_INV_MAP_PED_POS_MPV, |
| 7702 | L4_MABX_P.uD_Lookup_Table_maxIndex_h, 83U); |
| 7703 | |
| 7704 | /* Logic: '<S82>/Logical Operator' */ |
| 7705 | L4_MABX_B.LogicalOperator_j = !L4_MABX_B.AutonomousEnabled_d; |
| 7706 | |
| 7707 | /* Outputs for Atomic SubSystem: '<S82>/If_Then_Else' */ |
| 7708 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_j, Pedal_pwm_position, |
| 7709 | L4_MABX_B.uD_Lookup_Table, &L4_MABX_B.If_Then_Else_f); |
| 7710 | |
| 7711 | /* End of Outputs for SubSystem: '<S82>/If_Then_Else' */ |
| 7712 | |
| 7713 | /* RelationalOperator: '<S75>/Relational Operator' incorporates: |
| 7714 | * Constant: '<S75>/Constant' |
| 7715 | */ |
| 7716 | L4_MABX_B.APTC_arb_pedal_low_idl_sw_o = (APTC_PEDAL_LOW_IDLE_SW_THR_APV > |
| 7717 | L4_MABX_B.If_Then_Else_f.Switch); |
| 7718 | |
| 7719 | /* DataTypeConversion: '<S84>/Data Type Conversion1' */ |
| 7720 | L4_MABX_B.DataTypeConversion1_av = L4_MABX_B.SPN544_EngineReferenceTorque; |
| 7721 | |
| 7722 | /* RelationalOperator: '<S89>/Relational Operator1' incorporates: |
| 7723 | * Constant: '<S84>/EngRefTqLimHigh' |
| 7724 | */ |
| 7725 | L4_MABX_B.RelationalOperator1_i = (L4_MABX_B.DataTypeConversion1_av >= |
| 7726 | L4_MABX_P.EngRefTqLimHigh_Value); |
| 7727 | |
| 7728 | /* RelationalOperator: '<S89>/Relational Operator' incorporates: |
| 7729 | * Constant: '<S84>/EngRefTqLimLow' |
| 7730 | */ |
| 7731 | L4_MABX_B.RelationalOperator_ca = (L4_MABX_B.DataTypeConversion1_av <= |
| 7732 | L4_MABX_P.EngRefTqLimLow_Value); |
| 7733 | |
| 7734 | /* Outputs for Atomic SubSystem: '<S89>/If_Then_Else1' */ |
| 7735 | |
| 7736 | /* Constant: '<S84>/EngRefTqLimLow' */ |
| 7737 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_ca, |
| 7738 | L4_MABX_P.EngRefTqLimLow_Value, |
| 7739 | L4_MABX_B.DataTypeConversion1_av, |
| 7740 | &L4_MABX_B.If_Then_Else1_lo); |
| 7741 | |
| 7742 | /* End of Outputs for SubSystem: '<S89>/If_Then_Else1' */ |
| 7743 | |
| 7744 | /* Outputs for Atomic SubSystem: '<S89>/If_Then_Else' */ |
| 7745 | |
| 7746 | /* Constant: '<S84>/EngRefTqLimHigh' */ |
| 7747 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_i, |
| 7748 | L4_MABX_P.EngRefTqLimHigh_Value, |
| 7749 | L4_MABX_B.If_Then_Else1_lo.Switch, |
| 7750 | &L4_MABX_B.If_Then_Else_ff); |
| 7751 | |
| 7752 | /* End of Outputs for SubSystem: '<S89>/If_Then_Else' */ |
| 7753 | |
| 7754 | /* Sum: '<S84>/Subtract' incorporates: |
| 7755 | * Constant: '<S84>/FrictionTrqAtRefTrqSpeed' |
| 7756 | */ |
| 7757 | L4_MABX_B.Subtract_j0 = L4_MABX_B.If_Then_Else_ff.Switch - |
| 7758 | L4_MABX_P.FrictionTrqAtRefTrqSpeed_Value; |
| 7759 | |
| 7760 | /* Product: '<S84>/Divide' incorporates: |
| 7761 | * Constant: '<S84>/Constant1' |
| 7762 | */ |
| 7763 | L4_MABX_B.Divide_h = L4_MABX_B.If_Then_Else1_lw.Switch * |
| 7764 | L4_MABX_P.Constant1_Value_fg / L4_MABX_B.Subtract_j0; |
| 7765 | |
| 7766 | /* RelationalOperator: '<S90>/Relational Operator1' incorporates: |
| 7767 | * Constant: '<S84>/APPTqPercentMax' |
| 7768 | */ |
| 7769 | L4_MABX_B.RelationalOperator1_a = (L4_MABX_B.Divide_h >= |
| 7770 | L4_MABX_P.APPTqPercentMax_Value); |
| 7771 | |
| 7772 | /* RelationalOperator: '<S90>/Relational Operator' incorporates: |
| 7773 | * Constant: '<S84>/APPTqPercentMin' |
| 7774 | */ |
| 7775 | L4_MABX_B.RelationalOperator_n = (L4_MABX_B.Divide_h <= |
| 7776 | L4_MABX_P.APPTqPercentMin_Value); |
| 7777 | |
| 7778 | /* Outputs for Atomic SubSystem: '<S90>/If_Then_Else1' */ |
| 7779 | |
| 7780 | /* Constant: '<S84>/APPTqPercentMin' */ |
| 7781 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_n, |
| 7782 | L4_MABX_P.APPTqPercentMin_Value, L4_MABX_B.Divide_h, |
| 7783 | &L4_MABX_B.If_Then_Else1_pf); |
| 7784 | |
| 7785 | /* End of Outputs for SubSystem: '<S90>/If_Then_Else1' */ |
| 7786 | |
| 7787 | /* Outputs for Atomic SubSystem: '<S90>/If_Then_Else' */ |
| 7788 | |
| 7789 | /* Constant: '<S84>/APPTqPercentMax' */ |
| 7790 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_a, |
| 7791 | L4_MABX_P.APPTqPercentMax_Value, |
| 7792 | L4_MABX_B.If_Then_Else1_pf.Switch, |
| 7793 | &L4_MABX_B.If_Then_Else_iz); |
| 7794 | |
| 7795 | /* End of Outputs for SubSystem: '<S90>/If_Then_Else' */ |
| 7796 | |
| 7797 | /* MultiPortSwitch: '<S76>/Autonomous Mode Switch' incorporates: |
| 7798 | * Constant: '<S76>/AUTONOMOUS_MODE_SELECTOR_APV' |
| 7799 | * Constant: '<S76>/GhostMode' |
| 7800 | */ |
| 7801 | if (AUTONOMOUS_MODE_SELECTOR_APV == ENUM_AUTONOMOUS_MODE_T_AUTO) { |
| 7802 | AutonomousOutputEnabled = L4_MABX_B.AutonomousEnabled_d; |
| 7803 | } else { |
| 7804 | AutonomousOutputEnabled = (L4_MABX_P.GhostMode_Value != 0); |
| 7805 | } |
| 7806 | |
| 7807 | /* End of MultiPortSwitch: '<S76>/Autonomous Mode Switch' */ |
| 7808 | |
| 7809 | /* Switch: '<S76>/Switch' incorporates: |
| 7810 | * Constant: '<S76>/Failure' |
| 7811 | * Constant: '<S76>/Running' |
| 7812 | */ |
| 7813 | if (EStop) { |
| 7814 | tmp_1 = L4_MABX_P.Running_Value; |
| 7815 | if (tmp_1 < 0) { |
| 7816 | tmp_1 = 0; |
| 7817 | } |
| 7818 | |
| 7819 | MABX_Mode = (uint8_T)tmp_1; |
| 7820 | } else { |
| 7821 | tmp_1 = L4_MABX_P.Failure_Value; |
| 7822 | if (tmp_1 < 0) { |
| 7823 | tmp_1 = 0; |
| 7824 | } |
| 7825 | |
| 7826 | MABX_Mode = (uint8_T)tmp_1; |
| 7827 | } |
| 7828 | |
| 7829 | /* End of Switch: '<S76>/Switch' */ |
| 7830 | |
| 7831 | /* DataTypeConversion: '<S104>/Data Type Conversion2' */ |
| 7832 | PositionFinalLimited = floor(L4_MABX_B.SFunction1_o8_fp); |
| 7833 | if (rtIsNaN(PositionFinalLimited) || rtIsInf(PositionFinalLimited)) { |
| 7834 | PositionFinalLimited = 0.0; |
| 7835 | } else { |
| 7836 | PositionFinalLimited = fmod(PositionFinalLimited, 256.0); |
| 7837 | } |
| 7838 | |
| 7839 | L4_MABX_B.DataTypeConversion2_ew = (uint8_T)(PositionFinalLimited < 0.0 ? |
| 7840 | (int32_T)(uint8_T)-(int8_T)(uint8_T)-PositionFinalLimited : (int32_T) |
| 7841 | (uint8_T)PositionFinalLimited); |
| 7842 | |
| 7843 | /* End of DataTypeConversion: '<S104>/Data Type Conversion2' */ |
| 7844 | |
| 7845 | /* DataTypeConversion: '<S104>/Data Type Conversion' */ |
| 7846 | L4_MABX_B.DataTypeConversion_lr = (ENUM_SWITCH_T) |
| 7847 | L4_MABX_B.DataTypeConversion2_ew; |
| 7848 | |
| 7849 | /* DataTypeConversion: '<S104>/Data Type Conversion3' */ |
| 7850 | PositionFinalLimited = floor(L4_MABX_B.SFunction1_o4_nj); |
| 7851 | if (rtIsNaN(PositionFinalLimited) || rtIsInf(PositionFinalLimited)) { |
| 7852 | PositionFinalLimited = 0.0; |
| 7853 | } else { |
| 7854 | PositionFinalLimited = fmod(PositionFinalLimited, 256.0); |
| 7855 | } |
| 7856 | |
| 7857 | L4_MABX_B.DataTypeConversion3_ps = (uint8_T)(PositionFinalLimited < 0.0 ? |
| 7858 | (int32_T)(uint8_T)-(int8_T)(uint8_T)-PositionFinalLimited : (int32_T) |
| 7859 | (uint8_T)PositionFinalLimited); |
| 7860 | |
| 7861 | /* End of DataTypeConversion: '<S104>/Data Type Conversion3' */ |
| 7862 | |
| 7863 | /* DataTypeConversion: '<S104>/Data Type Conversion1' */ |
| 7864 | L4_MABX_B.DataTypeConversion1_lu = (ENUM_SWITCH_T) |
| 7865 | L4_MABX_B.DataTypeConversion3_ps; |
| 7866 | |
| 7867 | /* RelationalOperator: '<S104>/Relational Operator3' incorporates: |
| 7868 | * Constant: '<S104>/CPV3' |
| 7869 | */ |
| 7870 | L4_MABX_B.RelationalOperator3_c[0] = (L4_MABX_B.DataTypeConversion_lr == |
| 7871 | L4_MABX_P.CPV3_Value_p); |
| 7872 | L4_MABX_B.RelationalOperator3_c[1] = (L4_MABX_B.DataTypeConversion1_lu == |
| 7873 | L4_MABX_P.CPV3_Value_p); |
| 7874 | |
| 7875 | /* Logic: '<S104>/Logical Operator4' */ |
| 7876 | L4_MABX_B.LogicalOperator4_o = (L4_MABX_B.RelationalOperator3_c[0] && |
| 7877 | L4_MABX_B.RelationalOperator3_c[1]); |
| 7878 | |
| 7879 | /* Gain: '<S104>/Gain4' */ |
| 7880 | L4_MABX_B.Primary_brake_circuit_pressure_ = L4_MABX_P.Gain4_Gain * |
| 7881 | L4_MABX_B.PressureP42; |
| 7882 | |
| 7883 | /* Gain: '<S104>/Gain5' */ |
| 7884 | L4_MABX_B.Secondary_brake_circuit_pressur = L4_MABX_P.Gain5_Gain * |
| 7885 | L4_MABX_B.PressureP4; |
| 7886 | |
| 7887 | /* RelationalOperator: '<S104>/Relational Operator4' incorporates: |
| 7888 | * Constant: '<S104>/BRAKE_APPL_THRESHOLD_KPA_APV' |
| 7889 | */ |
| 7890 | L4_MABX_B.RelationalOperator4[0] = (L4_MABX_B.Primary_brake_circuit_pressure_ > |
| 7891 | L4_MABX_P.BRAKE_APPL_THRESHOLD_KPA_APV_Va); |
| 7892 | L4_MABX_B.RelationalOperator4[1] = (L4_MABX_B.Secondary_brake_circuit_pressur > |
| 7893 | L4_MABX_P.BRAKE_APPL_THRESHOLD_KPA_APV_Va); |
| 7894 | |
| 7895 | /* Logic: '<S104>/Logical Operator3' */ |
| 7896 | L4_MABX_B.F_Service_brake_pressure_applie = (L4_MABX_B.RelationalOperator4[0] || |
| 7897 | L4_MABX_B.RelationalOperator4[1]); |
| 7898 | |
| 7899 | /* RelationalOperator: '<S104>/Relational Operator6' incorporates: |
| 7900 | * Constant: '<S104>/CPV4' |
| 7901 | */ |
| 7902 | L4_MABX_B.RelationalOperator6[0] = (L4_MABX_B.DataTypeConversion_lr == |
| 7903 | L4_MABX_P.CPV4_Value_n); |
| 7904 | L4_MABX_B.RelationalOperator6[1] = (L4_MABX_B.DataTypeConversion1_lu == |
| 7905 | L4_MABX_P.CPV4_Value_n); |
| 7906 | |
| 7907 | /* Logic: '<S104>/Logical Operator' */ |
| 7908 | L4_MABX_B.F_Brake_sw_CAN = (L4_MABX_B.RelationalOperator6[0] || |
| 7909 | L4_MABX_B.RelationalOperator6[1]); |
| 7910 | |
| 7911 | /* Logic: '<S104>/Logical Operator5' */ |
| 7912 | L4_MABX_B.LogicalOperator5_n = (L4_MABX_B.F_Service_brake_pressure_applie || |
| 7913 | L4_MABX_B.F_Brake_sw_CAN); |
| 7914 | |
| 7915 | /* Outputs for Atomic SubSystem: '<S104>/If_Then_Else' */ |
| 7916 | L4_MABX_If_Then_Else_l(L4_MABX_B.LogicalOperator4_o, |
| 7917 | L4_MABX_B.F_Service_brake_pressure_applie, L4_MABX_B.LogicalOperator5_n, |
| 7918 | &L4_MABX_B.If_Then_Else_la); |
| 7919 | |
| 7920 | /* End of Outputs for SubSystem: '<S104>/If_Then_Else' */ |
| 7921 | |
| 7922 | /* RelationalOperator: '<S108>/Relational Operator1' incorporates: |
| 7923 | * Constant: '<S108>/SPN904_ZERO_SPD_CPV' |
| 7924 | */ |
| 7925 | L4_MABX_B.F_Vehicle_stopped = (L4_MABX_B.DataTypeConversion5_o <= |
| 7926 | L4_MABX_P.SPN904_ZERO_SPD_CPV_Value); |
| 7927 | |
| 7928 | /* Sum: '<S105>/Add' */ |
| 7929 | L4_MABX_B.Add_d = L4_MABX_B.Primary_brake_circuit_pressure_ + |
| 7930 | L4_MABX_B.Secondary_brake_circuit_pressur; |
| 7931 | |
| 7932 | /* Gain: '<S105>/Gain' */ |
| 7933 | L4_MABX_B.Gain_g = L4_MABX_P.Gain_Gain_g * L4_MABX_B.Add_d; |
| 7934 | |
| 7935 | /* Outputs for Enabled SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' incorporates: |
| 7936 | * EnablePort: '<S184>/Enable' |
| 7937 | */ |
| 7938 | if (L4_MABX_DW.Determine_shift_interlock_brake) { |
| 7939 | /* Disable for Outport: '<S184>/Shift_interlock_brake_press_target_kpa' */ |
| 7940 | L4_MABX_B.If_Then_Else_il.Switch = L4_MABX_P.Shift_interlock_brake_press_tar; |
| 7941 | |
| 7942 | /* Disable for Outport: '<S184>/F_Shift_interlock_conditions_met' */ |
| 7943 | L4_MABX_B.F_Shift_interlock_conditions_me = |
| 7944 | L4_MABX_P.F_Shift_interlock_conditions_me; |
| 7945 | L4_MABX_DW.Determine_shift_interlock_brake = false; |
| 7946 | } |
| 7947 | |
| 7948 | /* End of Outputs for SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */ |
| 7949 | |
| 7950 | /* RelationalOperator: '<S206>/Compare' incorporates: |
| 7951 | * Constant: '<S206>/Constant' |
| 7952 | */ |
| 7953 | L4_MABX_B.Compare_g = (L4_MABX_B.VSPD_TARGET_KPH_APV_g == |
| 7954 | L4_MABX_P.Constant_Value_ol); |
| 7955 | |
| 7956 | /* RelationalOperator: '<S109>/Relational Operator4' */ |
| 7957 | L4_MABX_B.RelationalOperator4_l = (L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b >= |
| 7958 | L4_MABX_B.DataTypeConversion5_o); |
| 7959 | |
| 7960 | /* Logic: '<S109>/Logical Operator3' */ |
| 7961 | L4_MABX_B.F_Hold_brakes_at_zero_d = (L4_MABX_B.F_Brake_control_active && |
| 7962 | L4_MABX_B.Compare_g && L4_MABX_B.RelationalOperator4_l); |
| 7963 | |
| 7964 | /* Outputs for Enabled SubSystem: '<S105>/Determine_brake_hold_pressure_target' incorporates: |
| 7965 | * EnablePort: '<S183>/Enable' |
| 7966 | */ |
| 7967 | if (L4_MABX_B.F_Hold_brakes_at_zero_d) { |
| 7968 | if (!L4_MABX_DW.Determine_brake_hold_pressure_t) { |
| 7969 | /* InitializeConditions for UnitDelay: '<S183>/Unit_Delay' */ |
| 7970 | L4_MABX_DW.Unit_Delay_DSTATE_c = L4_MABX_P.Unit_Delay_InitialCondition_d; |
| 7971 | |
| 7972 | /* InitializeConditions for UnitDelay: '<S187>/Unit_Delay' */ |
| 7973 | L4_MABX_DW.Unit_Delay_DSTATE_or = L4_MABX_P.Unit_Delay_InitialCondition_fy; |
| 7974 | |
| 7975 | /* InitializeConditions for UnitDelay: '<S191>/FixPt Unit Delay2' */ |
| 7976 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_je = |
| 7977 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_e; |
| 7978 | |
| 7979 | /* InitializeConditions for UnitDelay: '<S191>/FixPt Unit Delay1' */ |
| 7980 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_b = |
| 7981 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_p; |
| 7982 | |
| 7983 | /* InitializeConditions for UnitDelay: '<S188>/Unit_Delay' */ |
| 7984 | L4_MABX_DW.Unit_Delay_DSTATE_oj = L4_MABX_P.Unit_Delay_InitialCondition_k; |
| 7985 | L4_MABX_DW.Determine_brake_hold_pressure_t = true; |
| 7986 | } |
| 7987 | |
| 7988 | /* Logic: '<S183>/Logical Operator2' */ |
| 7989 | L4_MABX_B.F_Brake_hold_conditions_met = (L4_MABX_B.If_Then_Else_la.Switch && |
| 7990 | L4_MABX_B.F_Vehicle_stopped); |
| 7991 | |
| 7992 | /* UnitDelay: '<S183>/Unit_Delay' */ |
| 7993 | L4_MABX_B.Unit_Delay_a = L4_MABX_DW.Unit_Delay_DSTATE_c; |
| 7994 | |
| 7995 | /* UnitDelay: '<S187>/Unit_Delay' */ |
| 7996 | L4_MABX_B.Unit_Delay_h0 = L4_MABX_DW.Unit_Delay_DSTATE_or; |
| 7997 | |
| 7998 | /* Logic: '<S187>/Logical Operator1' incorporates: |
| 7999 | * Constant: '<S183>/CPV1' |
| 8000 | */ |
| 8001 | L4_MABX_B.LogicalOperator1_ou = (L4_MABX_P.CPV1_Value_p || |
| 8002 | L4_MABX_B.Unit_Delay_h0); |
| 8003 | |
| 8004 | /* Outputs for Atomic SubSystem: '<S183>/If_Then_Else1' */ |
| 8005 | |
| 8006 | /* Constant: '<S183>/CPV' */ |
| 8007 | L4_MABX_If_Then_Else_g(L4_MABX_B.F_Brake_hold_conditions_met, |
| 8008 | L4_MABX_B.Unit_Delay_a, L4_MABX_P.CPV_Value_k, &L4_MABX_B.If_Then_Else1_mf); |
| 8009 | |
| 8010 | /* End of Outputs for SubSystem: '<S183>/If_Then_Else1' */ |
| 8011 | |
| 8012 | /* UnitDelay: '<S191>/FixPt Unit Delay2' */ |
| 8013 | L4_MABX_B.FixPtUnitDelay2_d = L4_MABX_DW.FixPtUnitDelay2_DSTATE_je; |
| 8014 | |
| 8015 | /* UnitDelay: '<S191>/FixPt Unit Delay1' */ |
| 8016 | L4_MABX_B.Xold_b = L4_MABX_DW.FixPtUnitDelay1_DSTATE_b; |
| 8017 | |
| 8018 | /* Switch: '<S191>/Init' */ |
| 8019 | if (L4_MABX_B.FixPtUnitDelay2_d != 0) { |
| 8020 | L4_MABX_B.Init_k = L4_MABX_B.If_Then_Else1_mf.Switch; |
| 8021 | } else { |
| 8022 | L4_MABX_B.Init_k = L4_MABX_B.Xold_b; |
| 8023 | } |
| 8024 | |
| 8025 | /* End of Switch: '<S191>/Init' */ |
| 8026 | |
| 8027 | /* Abs: '<S187>/Abs' incorporates: |
| 8028 | * Constant: '<S183>/BRAKE_PRESS_TARGET_S LEW_INC_APV' |
| 8029 | */ |
| 8030 | L4_MABX_B.Abs_b = fabs(L4_MABX_P.BRAKE_PRESS_TARGET_SLEW_INC_APV); |
| 8031 | |
| 8032 | /* DigitalClock: '<S188>/Digital Clock' */ |
| 8033 | L4_MABX_B.DigitalClock_c = L4_MABX_M->Timing.t[0]; |
| 8034 | |
| 8035 | /* UnitDelay: '<S188>/Unit_Delay' */ |
| 8036 | L4_MABX_B.Unit_Delay_ka = L4_MABX_DW.Unit_Delay_DSTATE_oj; |
| 8037 | |
| 8038 | /* Sum: '<S188>/Subtract' */ |
| 8039 | L4_MABX_B.Subtract_ko = L4_MABX_B.DigitalClock_c - L4_MABX_B.Unit_Delay_ka; |
| 8040 | |
| 8041 | /* Product: '<S187>/Product1' */ |
| 8042 | L4_MABX_B.Product1_f = L4_MABX_B.Abs_b * L4_MABX_B.Subtract_ko; |
| 8043 | |
| 8044 | /* Sum: '<S187>/Add1' */ |
| 8045 | L4_MABX_B.Add1_c = L4_MABX_B.Init_k + L4_MABX_B.Product1_f; |
| 8046 | |
| 8047 | /* MinMax: '<S187>/MinMax2' */ |
| 8048 | DeltaTime = L4_MABX_B.If_Then_Else1_mf.Switch; |
| 8049 | PositionFinalLimited = L4_MABX_B.Add1_c; |
| 8050 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8051 | PositionFinalLimited = DeltaTime; |
| 8052 | } |
| 8053 | |
| 8054 | L4_MABX_B.MinMax2_c2 = PositionFinalLimited; |
| 8055 | |
| 8056 | /* End of MinMax: '<S187>/MinMax2' */ |
| 8057 | |
| 8058 | /* Abs: '<S187>/Abs1' incorporates: |
| 8059 | * Constant: '<S183>/BRAKE_PRESS_TARGET_SLEW_DEC_APV' |
| 8060 | */ |
| 8061 | L4_MABX_B.Abs1_ar = fabs(L4_MABX_P.BRAKE_PRESS_TARGET_SLEW_DEC_APV); |
| 8062 | |
| 8063 | /* Product: '<S187>/Product2' */ |
| 8064 | L4_MABX_B.Product2_c3 = L4_MABX_B.Subtract_ko * L4_MABX_B.Abs1_ar; |
| 8065 | |
| 8066 | /* Sum: '<S187>/Subtract1' */ |
| 8067 | L4_MABX_B.Subtract1_ev = L4_MABX_B.Init_k - L4_MABX_B.Product2_c3; |
| 8068 | |
| 8069 | /* MinMax: '<S187>/MinMax1' */ |
| 8070 | DeltaTime = L4_MABX_B.MinMax2_c2; |
| 8071 | PositionFinalLimited = L4_MABX_B.Subtract1_ev; |
| 8072 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8073 | PositionFinalLimited = DeltaTime; |
| 8074 | } |
| 8075 | |
| 8076 | L4_MABX_B.MinMax1_jw = PositionFinalLimited; |
| 8077 | |
| 8078 | /* End of MinMax: '<S187>/MinMax1' */ |
| 8079 | |
| 8080 | /* Outputs for Atomic SubSystem: '<S187>/If_Then_Else' */ |
| 8081 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_ou, L4_MABX_B.Gain_g, |
| 8082 | L4_MABX_B.MinMax1_jw, &L4_MABX_B.If_Then_Else_nz); |
| 8083 | |
| 8084 | /* End of Outputs for SubSystem: '<S187>/If_Then_Else' */ |
| 8085 | |
| 8086 | /* Outputs for Atomic SubSystem: '<S183>/If_Then_Else' */ |
| 8087 | L4_MABX_If_Then_Else_g(L4_MABX_B.F_Brake_hold_conditions_met, |
| 8088 | L4_MABX_B.Unit_Delay_a, L4_MABX_B.If_Then_Else_nz.Switch, |
| 8089 | &L4_MABX_B.If_Then_Else_gj); |
| 8090 | |
| 8091 | /* End of Outputs for SubSystem: '<S183>/If_Then_Else' */ |
| 8092 | |
| 8093 | /* RelationalOperator: '<S189>/min_relop' incorporates: |
| 8094 | * Constant: '<S183>/BRAKE_PRESS_TARGET_S LEW_INC_APV' |
| 8095 | * Constant: '<S189>/min_val' |
| 8096 | */ |
| 8097 | L4_MABX_B.min_relop_i = (L4_MABX_P.CheckStaticLowerBound_min_i <= |
| 8098 | L4_MABX_P.BRAKE_PRESS_TARGET_SLEW_INC_APV); |
| 8099 | |
| 8100 | /* Assertion: '<S189>/Assertion' */ |
| 8101 | utAssert(L4_MABX_B.min_relop_i); |
| 8102 | } else { |
| 8103 | if (L4_MABX_DW.Determine_brake_hold_pressure_t) { |
| 8104 | /* Disable for Outport: '<S183>/Brake_hold_brake_press_target_kpa' */ |
| 8105 | L4_MABX_B.If_Then_Else_gj.Switch = |
| 8106 | L4_MABX_P.Brake_hold_brake_press_target_k; |
| 8107 | |
| 8108 | /* Disable for Outport: '<S183>/F_Brake_hold_conditions_met' */ |
| 8109 | L4_MABX_B.F_Brake_hold_conditions_met = |
| 8110 | L4_MABX_P.F_Brake_hold_conditions_met_Y0; |
| 8111 | L4_MABX_DW.Determine_brake_hold_pressure_t = false; |
| 8112 | } |
| 8113 | } |
| 8114 | |
| 8115 | /* End of Outputs for SubSystem: '<S105>/Determine_brake_hold_pressure_target' */ |
| 8116 | |
| 8117 | /* MinMax: '<S105>/MinMax' */ |
| 8118 | DeltaTime = L4_MABX_B.If_Then_Else_il.Switch; |
| 8119 | PositionFinalLimited = L4_MABX_B.If_Then_Else_gj.Switch; |
| 8120 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8121 | PositionFinalLimited = DeltaTime; |
| 8122 | } |
| 8123 | |
| 8124 | L4_MABX_B.Brake_pressure_target_kpa = PositionFinalLimited; |
| 8125 | |
| 8126 | /* End of MinMax: '<S105>/MinMax' */ |
| 8127 | |
| 8128 | /* Gain: '<S104>/Gain1' */ |
| 8129 | L4_MABX_B.Bendix_2C2_Primary_brake_circui = L4_MABX_P.Gain1_Gain * |
| 8130 | L4_MABX_B.PressureP21; |
| 8131 | |
| 8132 | /* Gain: '<S104>/Gain2' */ |
| 8133 | L4_MABX_B.Bendix_2C2_Secondary_brake_circ = L4_MABX_P.Gain2_Gain * |
| 8134 | L4_MABX_B.PressureP22; |
| 8135 | |
| 8136 | /* Sum: '<S106>/Add' */ |
| 8137 | L4_MABX_B.Add_n = L4_MABX_B.Primary_brake_circuit_pressure_ + |
| 8138 | L4_MABX_B.Secondary_brake_circuit_pressur; |
| 8139 | |
| 8140 | /* Gain: '<S106>/Gain' */ |
| 8141 | L4_MABX_B.brake_system_avg_appl_pressure_ = L4_MABX_P.Gain_Gain_i * |
| 8142 | L4_MABX_B.Add_n; |
| 8143 | |
| 8144 | /* Gain: '<S104>/Gain3' */ |
| 8145 | L4_MABX_B.Primary_brake_circuit_pressur_n = L4_MABX_P.Gain3_Gain * |
| 8146 | L4_MABX_B.PressureP1; |
| 8147 | |
| 8148 | /* Product: '<S106>/Divide2' */ |
| 8149 | L4_MABX_B.Divide2 = L4_MABX_B.brake_system_avg_appl_pressure_ / |
| 8150 | L4_MABX_B.Primary_brake_circuit_pressur_n; |
| 8151 | |
| 8152 | /* Gain: '<S106>/Gain5' */ |
| 8153 | L4_MABX_B.Gain5 = L4_MABX_P.Gain5_Gain_l * L4_MABX_B.Divide2; |
| 8154 | |
| 8155 | /* Saturate: '<S106>/Saturation3' */ |
| 8156 | DeltaTime = L4_MABX_B.Gain5; |
| 8157 | Time56 = L4_MABX_P.Saturation3_LowerSat; |
| 8158 | AccelerationAverage = L4_MABX_P.Saturation3_UpperSat; |
| 8159 | if (DeltaTime > AccelerationAverage) { |
| 8160 | L4_MABX_B.Brake_appl_percent = AccelerationAverage; |
| 8161 | } else if (DeltaTime < Time56) { |
| 8162 | L4_MABX_B.Brake_appl_percent = Time56; |
| 8163 | } else { |
| 8164 | L4_MABX_B.Brake_appl_percent = DeltaTime; |
| 8165 | } |
| 8166 | |
| 8167 | /* End of Saturate: '<S106>/Saturation3' */ |
| 8168 | |
| 8169 | /* Outputs for Enabled SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' incorporates: |
| 8170 | * EnablePort: '<S102>/Enable' |
| 8171 | */ |
| 8172 | if (L4_MABX_B.F_Hold_brakes_at_zero_d) { |
| 8173 | if (!L4_MABX_DW.Bendix_2C2_brake_application_pr) { |
| 8174 | /* InitializeConditions for UnitDelay: '<S111>/Unit_Delay' */ |
| 8175 | L4_MABX_DW.Unit_Delay_DSTATE_dc = L4_MABX_P.Unit_Delay_InitialCondition; |
| 8176 | |
| 8177 | /* InitializeConditions for UnitDelay: '<S115>/Unit_Delay' */ |
| 8178 | L4_MABX_DW.Unit_Delay_DSTATE_omj = |
| 8179 | L4_MABX_P.Unit_Delay_InitialCondition_lt; |
| 8180 | |
| 8181 | /* InitializeConditions for UnitDelay: '<S135>/Unit_Delay1' */ |
| 8182 | L4_MABX_DW.Unit_Delay1_DSTATE_b = L4_MABX_P.Unit_Delay1_InitialCondition; |
| 8183 | |
| 8184 | /* InitializeConditions for UnitDelay: '<S136>/Unit_Delay' */ |
| 8185 | L4_MABX_DW.Unit_Delay_DSTATE_h4 = L4_MABX_P.Unit_Delay_InitialCondition_og; |
| 8186 | |
| 8187 | /* InitializeConditions for UnitDelay: '<S140>/FixPt Unit Delay2' */ |
| 8188 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_gm = |
| 8189 | L4_MABX_P.FixPtUnitDelay2_InitialConditio; |
| 8190 | |
| 8191 | /* InitializeConditions for UnitDelay: '<S140>/FixPt Unit Delay1' */ |
| 8192 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g1 = |
| 8193 | L4_MABX_P.FixPtUnitDelay1_InitialConditio; |
| 8194 | |
| 8195 | /* InitializeConditions for UnitDelay: '<S135>/Unit_Delay2' */ |
| 8196 | L4_MABX_DW.Unit_Delay2_DSTATE_dy = L4_MABX_P.Unit_Delay2_InitialCondition; |
| 8197 | |
| 8198 | /* InitializeConditions for UnitDelay: '<S110>/Unit_Delay' */ |
| 8199 | L4_MABX_DW.Unit_Delay_DSTATE_i2 = L4_MABX_P.Unit_Delay_InitialCondition_p; |
| 8200 | L4_MABX_DW.Bendix_2C2_brake_application_pr = true; |
| 8201 | } |
| 8202 | |
| 8203 | /* Sum: '<S102>/Add' */ |
| 8204 | L4_MABX_B.Add_my = L4_MABX_B.Bendix_2C2_Primary_brake_circui + |
| 8205 | L4_MABX_B.Bendix_2C2_Secondary_brake_circ; |
| 8206 | |
| 8207 | /* Gain: '<S102>/Gain' */ |
| 8208 | L4_MABX_B.Gain_i = L4_MABX_P.Gain_Gain * L4_MABX_B.Add_my; |
| 8209 | |
| 8210 | /* Abs: '<S112>/Abs' incorporates: |
| 8211 | * Constant: '<S102>/BRK_PRESS_DEM_KI_APV' |
| 8212 | */ |
| 8213 | L4_MABX_B.Abs_k4 = fabs(L4_MABX_P.BRK_PRESS_DEM_KI_APV_Value); |
| 8214 | |
| 8215 | /* Abs: '<S112>/Abs1' incorporates: |
| 8216 | * Constant: '<S102>/BRK_PRESS_DEM_KD_APV' |
| 8217 | */ |
| 8218 | L4_MABX_B.Abs1_ap = fabs(L4_MABX_P.BRK_PRESS_DEM_KD_APV_Value); |
| 8219 | |
| 8220 | /* DigitalClock: '<S111>/Digital Clock' */ |
| 8221 | L4_MABX_B.DigitalClock_j = L4_MABX_M->Timing.t[0]; |
| 8222 | |
| 8223 | /* UnitDelay: '<S111>/Unit_Delay' */ |
| 8224 | L4_MABX_B.Unit_Delay_j = L4_MABX_DW.Unit_Delay_DSTATE_dc; |
| 8225 | |
| 8226 | /* Sum: '<S111>/Subtract' */ |
| 8227 | L4_MABX_B.Subtract_jr = L4_MABX_B.DigitalClock_j - L4_MABX_B.Unit_Delay_j; |
| 8228 | |
| 8229 | /* UnitDelay: '<S115>/Unit_Delay' */ |
| 8230 | L4_MABX_B.Unit_Delay_nm = L4_MABX_DW.Unit_Delay_DSTATE_omj; |
| 8231 | |
| 8232 | /* Logic: '<S115>/Logical Operator1' incorporates: |
| 8233 | * Constant: '<S102>/CPV2' |
| 8234 | */ |
| 8235 | L4_MABX_B.LogicalOperator1_ax = (L4_MABX_B.Unit_Delay_nm || |
| 8236 | L4_MABX_P.CPV2_Value_m); |
| 8237 | |
| 8238 | /* UnitDelay: '<S135>/Unit_Delay1' */ |
| 8239 | L4_MABX_B.Unit_Delay1_i = L4_MABX_DW.Unit_Delay1_DSTATE_b; |
| 8240 | |
| 8241 | /* Logic: '<S135>/Logical Operator' */ |
| 8242 | L4_MABX_B.LogicalOperator_m = (L4_MABX_B.LogicalOperator1_ax || |
| 8243 | L4_MABX_B.Unit_Delay1_i); |
| 8244 | |
| 8245 | /* UnitDelay: '<S136>/Unit_Delay' */ |
| 8246 | L4_MABX_B.Unit_Delay_nl = L4_MABX_DW.Unit_Delay_DSTATE_h4; |
| 8247 | |
| 8248 | /* Logic: '<S136>/Logical Operator1' */ |
| 8249 | L4_MABX_B.LogicalOperator1_mk = (L4_MABX_B.LogicalOperator1_ax || |
| 8250 | L4_MABX_B.Unit_Delay_nl); |
| 8251 | |
| 8252 | /* UnitDelay: '<S140>/FixPt Unit Delay2' */ |
| 8253 | L4_MABX_B.FixPtUnitDelay2_op = L4_MABX_DW.FixPtUnitDelay2_DSTATE_gm; |
| 8254 | |
| 8255 | /* UnitDelay: '<S140>/FixPt Unit Delay1' */ |
| 8256 | L4_MABX_B.Xold_g3 = L4_MABX_DW.FixPtUnitDelay1_DSTATE_g1; |
| 8257 | |
| 8258 | /* Switch: '<S140>/Init' */ |
| 8259 | if (L4_MABX_B.FixPtUnitDelay2_op != 0) { |
| 8260 | L4_MABX_B.Init_hw = L4_MABX_B.Brake_pressure_target_kpa; |
| 8261 | } else { |
| 8262 | L4_MABX_B.Init_hw = L4_MABX_B.Xold_g3; |
| 8263 | } |
| 8264 | |
| 8265 | /* End of Switch: '<S140>/Init' */ |
| 8266 | |
| 8267 | /* Abs: '<S136>/Abs' incorporates: |
| 8268 | * Constant: '<S102>/CPV4' |
| 8269 | */ |
| 8270 | L4_MABX_B.Abs_l = fabs(L4_MABX_P.CPV4_Value); |
| 8271 | |
| 8272 | /* Product: '<S136>/Product1' */ |
| 8273 | L4_MABX_B.Product1_b = L4_MABX_B.Abs_l * L4_MABX_B.Subtract_jr; |
| 8274 | |
| 8275 | /* Sum: '<S136>/Add1' */ |
| 8276 | L4_MABX_B.Add1_hu = L4_MABX_B.Init_hw + L4_MABX_B.Product1_b; |
| 8277 | |
| 8278 | /* MinMax: '<S136>/MinMax2' */ |
| 8279 | DeltaTime = L4_MABX_B.Brake_pressure_target_kpa; |
| 8280 | PositionFinalLimited = L4_MABX_B.Add1_hu; |
| 8281 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8282 | PositionFinalLimited = DeltaTime; |
| 8283 | } |
| 8284 | |
| 8285 | L4_MABX_B.MinMax2_b = PositionFinalLimited; |
| 8286 | |
| 8287 | /* End of MinMax: '<S136>/MinMax2' */ |
| 8288 | |
| 8289 | /* Abs: '<S136>/Abs1' incorporates: |
| 8290 | * Constant: '<S102>/CPV5' |
| 8291 | */ |
| 8292 | L4_MABX_B.Abs1_d1 = fabs(L4_MABX_P.CPV5_Value); |
| 8293 | |
| 8294 | /* Product: '<S136>/Product2' */ |
| 8295 | L4_MABX_B.Product2_dl = L4_MABX_B.Subtract_jr * L4_MABX_B.Abs1_d1; |
| 8296 | |
| 8297 | /* Sum: '<S136>/Subtract1' */ |
| 8298 | L4_MABX_B.Subtract1_a = L4_MABX_B.Init_hw - L4_MABX_B.Product2_dl; |
| 8299 | |
| 8300 | /* MinMax: '<S136>/MinMax1' */ |
| 8301 | DeltaTime = L4_MABX_B.MinMax2_b; |
| 8302 | PositionFinalLimited = L4_MABX_B.Subtract1_a; |
| 8303 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8304 | PositionFinalLimited = DeltaTime; |
| 8305 | } |
| 8306 | |
| 8307 | L4_MABX_B.MinMax1_ps = PositionFinalLimited; |
| 8308 | |
| 8309 | /* End of MinMax: '<S136>/MinMax1' */ |
| 8310 | |
| 8311 | /* Outputs for Atomic SubSystem: '<S136>/If_Then_Else' */ |
| 8312 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_mk, L4_MABX_B.Gain_i, |
| 8313 | L4_MABX_B.MinMax1_ps, &L4_MABX_B.If_Then_Else_bg); |
| 8314 | |
| 8315 | /* End of Outputs for SubSystem: '<S136>/If_Then_Else' */ |
| 8316 | |
| 8317 | /* Sum: '<S113>/Subtract' */ |
| 8318 | L4_MABX_B.Subtract_n = L4_MABX_B.If_Then_Else_bg.Switch - L4_MABX_B.Gain_i; |
| 8319 | |
| 8320 | /* MinMax: '<S135>/MinMax1' incorporates: |
| 8321 | * Constant: '<S102>/BRK_PRESS_DEM_T_FILT_CTRL_ERROR_APV' |
| 8322 | */ |
| 8323 | DeltaTime = L4_MABX_B.Subtract_jr; |
| 8324 | PositionFinalLimited = L4_MABX_P.BRK_PRESS_DEM_T_FILT_CTRL_ERROR; |
| 8325 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8326 | PositionFinalLimited = DeltaTime; |
| 8327 | } |
| 8328 | |
| 8329 | L4_MABX_B.MinMax1_h1 = PositionFinalLimited; |
| 8330 | |
| 8331 | /* End of MinMax: '<S135>/MinMax1' */ |
| 8332 | |
| 8333 | /* Saturate: '<S135>/Saturation' */ |
| 8334 | DeltaTime = L4_MABX_B.MinMax1_h1; |
| 8335 | Time56 = L4_MABX_P.Saturation_LowerSat; |
| 8336 | AccelerationAverage = L4_MABX_P.Saturation_UpperSat; |
| 8337 | if (DeltaTime > AccelerationAverage) { |
| 8338 | L4_MABX_B.Saturation_p = AccelerationAverage; |
| 8339 | } else if (DeltaTime < Time56) { |
| 8340 | L4_MABX_B.Saturation_p = Time56; |
| 8341 | } else { |
| 8342 | L4_MABX_B.Saturation_p = DeltaTime; |
| 8343 | } |
| 8344 | |
| 8345 | /* End of Saturate: '<S135>/Saturation' */ |
| 8346 | |
| 8347 | /* Product: '<S135>/Divide' */ |
| 8348 | L4_MABX_B.Divide_lm = L4_MABX_B.Subtract_jr / L4_MABX_B.Saturation_p; |
| 8349 | |
| 8350 | /* Product: '<S135>/Product2' */ |
| 8351 | L4_MABX_B.Product2_kj = L4_MABX_B.Subtract_n * L4_MABX_B.Divide_lm; |
| 8352 | |
| 8353 | /* Sum: '<S135>/Subtract1' incorporates: |
| 8354 | * Constant: '<S135>/Constant1' |
| 8355 | */ |
| 8356 | L4_MABX_B.Subtract1_pm = L4_MABX_P.Constant1_Value_f - L4_MABX_B.Divide_lm; |
| 8357 | |
| 8358 | /* UnitDelay: '<S135>/Unit_Delay2' */ |
| 8359 | L4_MABX_B.Unit_Delay2_d = L4_MABX_DW.Unit_Delay2_DSTATE_dy; |
| 8360 | |
| 8361 | /* Product: '<S135>/Product1' */ |
| 8362 | L4_MABX_B.Product1_c3 = L4_MABX_B.Subtract1_pm * L4_MABX_B.Unit_Delay2_d; |
| 8363 | |
| 8364 | /* Sum: '<S135>/Add1' */ |
| 8365 | L4_MABX_B.Add1_i1 = L4_MABX_B.Product2_kj + L4_MABX_B.Product1_c3; |
| 8366 | |
| 8367 | /* Outputs for Atomic SubSystem: '<S135>/If_Then_Else' */ |
| 8368 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_m, L4_MABX_B.Subtract_n, |
| 8369 | L4_MABX_B.Add1_i1, &L4_MABX_B.If_Then_Else_ly); |
| 8370 | |
| 8371 | /* End of Outputs for SubSystem: '<S135>/If_Then_Else' */ |
| 8372 | |
| 8373 | /* RelationalOperator: '<S120>/Compare' incorporates: |
| 8374 | * Constant: '<S120>/Constant' |
| 8375 | */ |
| 8376 | L4_MABX_B.Compare_aa = (L4_MABX_B.Abs1_ap > |
| 8377 | L4_MABX_P.CompareToConstant1_const); |
| 8378 | |
| 8379 | /* Outputs for Enabled SubSystem: '<S112>/Calculate_D_term' */ |
| 8380 | |
| 8381 | /* Constant: '<S102>/BRK_PRESS_DEM_KD_APV' incorporates: |
| 8382 | * Constant: '<S102>/BRK_PRESS_DEM_T_FILT_D_APV' |
| 8383 | */ |
| 8384 | L4_MABX_Calculate_D_term(L4_MABX_B.Compare_aa, |
| 8385 | L4_MABX_P.BRK_PRESS_DEM_KD_APV_Value, L4_MABX_B.Subtract_jr, |
| 8386 | L4_MABX_B.LogicalOperator1_ax, L4_MABX_B.If_Then_Else_ly.Switch, |
| 8387 | L4_MABX_P.BRK_PRESS_DEM_T_FILT_D_APV_Valu, &L4_MABX_B.Calculate_D_term, |
| 8388 | &L4_MABX_DW.Calculate_D_term, &L4_MABX_P.Calculate_D_term); |
| 8389 | |
| 8390 | /* End of Outputs for SubSystem: '<S112>/Calculate_D_term' */ |
| 8391 | |
| 8392 | /* Product: '<S118>/Product' incorporates: |
| 8393 | * Constant: '<S102>/BRK_PRESS_DEM_KP_APV' |
| 8394 | */ |
| 8395 | L4_MABX_B.Product_iq = L4_MABX_P.BRK_PRESS_DEM_KP_APV_Value * |
| 8396 | L4_MABX_B.If_Then_Else_ly.Switch; |
| 8397 | |
| 8398 | /* UnitDelay: '<S110>/Unit_Delay' */ |
| 8399 | L4_MABX_B.Unit_Delay_ja = L4_MABX_DW.Unit_Delay_DSTATE_i2; |
| 8400 | |
| 8401 | /* RelationalOperator: '<S119>/Compare' incorporates: |
| 8402 | * Constant: '<S119>/Constant' |
| 8403 | */ |
| 8404 | L4_MABX_B.Compare_jrp = (L4_MABX_B.Abs_k4 > |
| 8405 | L4_MABX_P.CompareToConstant_const); |
| 8406 | |
| 8407 | /* Outputs for Enabled SubSystem: '<S112>/Calculate_I_term' */ |
| 8408 | |
| 8409 | /* Constant: '<S102>/BRK_PRESS_DEM_KI_APV' incorporates: |
| 8410 | * Constant: '<S102>/BRK_PRESS_DEM_AW_COND_INT_APV' |
| 8411 | * Constant: '<S102>/BRK_PRESS_DEM_AW_HYSTERESIS_APV' |
| 8412 | * Constant: '<S102>/CPV1' |
| 8413 | * Constant: '<S102>/CPV3' |
| 8414 | */ |
| 8415 | L4_MABX_Calculate_I_term(L4_MABX_B.Compare_jrp, L4_MABX_B.Product_iq, |
| 8416 | L4_MABX_P.BRK_PRESS_DEM_KI_APV_Value, L4_MABX_B.Brake_appl_percent, |
| 8417 | L4_MABX_B.If_Then_Else_ly.Switch, L4_MABX_B.LogicalOperator1_ax, |
| 8418 | L4_MABX_B.Subtract_jr, L4_MABX_P.CPV3_Value, |
| 8419 | L4_MABX_P.BRK_PRESS_DEM_AW_COND_INT_APV_V, |
| 8420 | L4_MABX_P.BRK_PRESS_DEM_AW_HYSTERESIS_APV, L4_MABX_P.CPV1_Value_g, |
| 8421 | L4_MABX_B.Unit_Delay_ja, &L4_MABX_B.Calculate_I_term, |
| 8422 | &L4_MABX_DW.Calculate_I_term, &L4_MABX_P.Calculate_I_term); |
| 8423 | |
| 8424 | /* End of Outputs for SubSystem: '<S112>/Calculate_I_term' */ |
| 8425 | |
| 8426 | /* RelationalOperator: '<S138>/min_relop' incorporates: |
| 8427 | * Constant: '<S102>/CPV4' |
| 8428 | * Constant: '<S138>/min_val' |
| 8429 | */ |
| 8430 | L4_MABX_B.min_relop_p = (L4_MABX_P.CheckStaticLowerBound_min <= |
| 8431 | L4_MABX_P.CPV4_Value); |
| 8432 | |
| 8433 | /* Assertion: '<S138>/Assertion' */ |
| 8434 | utAssert(L4_MABX_B.min_relop_p); |
| 8435 | |
| 8436 | /* Sum: '<S114>/Add' incorporates: |
| 8437 | * Constant: '<S102>/CPV3' |
| 8438 | */ |
| 8439 | L4_MABX_B.Add_e = ((L4_MABX_B.Product_iq + |
| 8440 | L4_MABX_B.Calculate_I_term.If_Then_Else.Switch) + |
| 8441 | L4_MABX_B.Calculate_D_term.Subtract) + |
| 8442 | L4_MABX_P.CPV3_Value; |
| 8443 | |
| 8444 | /* RelationalOperator: '<S141>/Relational Operator1' incorporates: |
| 8445 | * Constant: '<S102>/CPV6' |
| 8446 | */ |
| 8447 | L4_MABX_B.RelationalOperator1_gi = (L4_MABX_B.Add_e >= L4_MABX_P.CPV6_Value); |
| 8448 | |
| 8449 | /* RelationalOperator: '<S141>/Relational Operator' incorporates: |
| 8450 | * Constant: '<S102>/CPV' |
| 8451 | */ |
| 8452 | L4_MABX_B.RelationalOperator_b = (L4_MABX_B.Add_e <= L4_MABX_P.CPV_Value); |
| 8453 | |
| 8454 | /* Outputs for Atomic SubSystem: '<S141>/If_Then_Else1' */ |
| 8455 | |
| 8456 | /* Constant: '<S102>/CPV' */ |
| 8457 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_b, L4_MABX_P.CPV_Value, |
| 8458 | L4_MABX_B.Add_e, &L4_MABX_B.If_Then_Else1_bq); |
| 8459 | |
| 8460 | /* End of Outputs for SubSystem: '<S141>/If_Then_Else1' */ |
| 8461 | |
| 8462 | /* Outputs for Atomic SubSystem: '<S141>/If_Then_Else' */ |
| 8463 | |
| 8464 | /* Constant: '<S102>/CPV6' */ |
| 8465 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_gi, L4_MABX_P.CPV6_Value, |
| 8466 | L4_MABX_B.If_Then_Else1_bq.Switch, |
| 8467 | &L4_MABX_B.If_Then_Else_nj); |
| 8468 | |
| 8469 | /* End of Outputs for SubSystem: '<S141>/If_Then_Else' */ |
| 8470 | } else { |
| 8471 | if (L4_MABX_DW.Bendix_2C2_brake_application_pr) { |
| 8472 | /* Disable for Enabled SubSystem: '<S112>/Calculate_D_term' */ |
| 8473 | if (L4_MABX_DW.Calculate_D_term.Calculate_D_term_MODE) { |
| 8474 | L4_Calculate_D_term_Disable(&L4_MABX_B.Calculate_D_term, |
| 8475 | &L4_MABX_DW.Calculate_D_term, &L4_MABX_P.Calculate_D_term); |
| 8476 | } |
| 8477 | |
| 8478 | /* End of Disable for SubSystem: '<S112>/Calculate_D_term' */ |
| 8479 | |
| 8480 | /* Disable for Enabled SubSystem: '<S112>/Calculate_I_term' */ |
| 8481 | if (L4_MABX_DW.Calculate_I_term.Calculate_I_term_MODE) { |
| 8482 | L4_Calculate_I_term_Disable(&L4_MABX_B.Calculate_I_term, |
| 8483 | &L4_MABX_DW.Calculate_I_term, &L4_MABX_P.Calculate_I_term); |
| 8484 | } |
| 8485 | |
| 8486 | /* End of Disable for SubSystem: '<S112>/Calculate_I_term' */ |
| 8487 | |
| 8488 | /* Disable for Outport: '<S102>/PID_output' */ |
| 8489 | L4_MABX_B.If_Then_Else_nj.Switch = L4_MABX_P.PID_output_Y0; |
| 8490 | L4_MABX_DW.Bendix_2C2_brake_application_pr = false; |
| 8491 | } |
| 8492 | } |
| 8493 | |
| 8494 | /* End of Outputs for SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */ |
| 8495 | |
| 8496 | /* RelationalOperator: '<S393>/Compare' incorporates: |
| 8497 | * Constant: '<S393>/Constant' |
| 8498 | */ |
| 8499 | L4_MABX_B.Compare_ey = (L4_MABX_B.SFunction1_o4_lj == |
| 8500 | L4_MABX_P.CompareToConstant9_const); |
| 8501 | |
| 8502 | /* RelationalOperator: '<S390>/Compare' incorporates: |
| 8503 | * Constant: '<S390>/Constant' |
| 8504 | */ |
| 8505 | L4_MABX_B.Compare_jb = (L4_MABX_B.SFunction1_o5_i == |
| 8506 | L4_MABX_P.CompareToConstant10_const); |
| 8507 | |
| 8508 | /* RelationalOperator: '<S391>/Compare' incorporates: |
| 8509 | * Constant: '<S391>/Constant' |
| 8510 | */ |
| 8511 | L4_MABX_B.Compare_hc = (L4_MABX_B.SFunction1_o6_d == |
| 8512 | L4_MABX_P.CompareToConstant11_const); |
| 8513 | |
| 8514 | /* RelationalOperator: '<S392>/Compare' incorporates: |
| 8515 | * Constant: '<S392>/Constant' |
| 8516 | */ |
| 8517 | L4_MABX_B.Compare_bp = (L4_MABX_B.SFunction1_o7_h == |
| 8518 | L4_MABX_P.CompareToConstant12_const); |
| 8519 | |
| 8520 | /* Logic: '<S353>/Logical Operator2' */ |
| 8521 | L4_MABX_B.LogicalOperator2_f = (L4_MABX_B.Compare_ey || L4_MABX_B.Compare_jb || |
| 8522 | L4_MABX_B.Compare_hc || L4_MABX_B.Compare_bp); |
| 8523 | |
| 8524 | /* UnitDelay: '<S395>/Unit_Delay' */ |
| 8525 | L4_MABX_B.Unit_Delay_o = L4_MABX_DW.Unit_Delay_DSTATE_cx; |
| 8526 | |
| 8527 | /* Logic: '<S395>/Logical Operator1' */ |
| 8528 | L4_MABX_B.LogicalOperator1_j = !L4_MABX_B.Unit_Delay_o; |
| 8529 | |
| 8530 | /* Logic: '<S395>/Logical Operator' */ |
| 8531 | L4_MABX_B.LogicalOperator_f = (L4_MABX_B.LogicalOperator2_f && |
| 8532 | L4_MABX_B.LogicalOperator1_j); |
| 8533 | |
| 8534 | /* UnitDelay: '<S396>/Unit_Delay' */ |
| 8535 | L4_MABX_B.Unit_Delay_jz = L4_MABX_DW.Unit_Delay_DSTATE_d0; |
| 8536 | |
| 8537 | /* Logic: '<S396>/Logical Operator1' */ |
| 8538 | L4_MABX_B.LogicalOperator1_ao = (L4_MABX_B.LogicalOperator_f || |
| 8539 | L4_MABX_B.Unit_Delay_jz); |
| 8540 | |
| 8541 | /* UnitDelay: '<S353>/Unit_Delay' */ |
| 8542 | L4_MABX_B.Unit_Delay_k4 = L4_MABX_DW.Unit_Delay_DSTATE_e; |
| 8543 | |
| 8544 | /* MinMax: '<S353>/MinMax' */ |
| 8545 | DeltaTime = L4_MABX_B.Unit_Delay_k4; |
| 8546 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_gd; |
| 8547 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8548 | PositionFinalLimited = DeltaTime; |
| 8549 | } |
| 8550 | |
| 8551 | L4_MABX_B.MinMax_d = PositionFinalLimited; |
| 8552 | |
| 8553 | /* End of MinMax: '<S353>/MinMax' */ |
| 8554 | |
| 8555 | /* Outputs for Atomic SubSystem: '<S353>/If_Then_Else4' */ |
| 8556 | |
| 8557 | /* Constant: '<S353>/STABILITY_ACTIVE_VSPD_TARGET_APV' incorporates: |
| 8558 | * Constant: '<S353>/Constant4' |
| 8559 | */ |
| 8560 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator2_f, |
| 8561 | L4_MABX_P.STABILITY_ACTIVE_VSPD_TARGET_AP, |
| 8562 | L4_MABX_P.Constant4_Value_n, &L4_MABX_B.If_Then_Else4_h); |
| 8563 | |
| 8564 | /* End of Outputs for SubSystem: '<S353>/If_Then_Else4' */ |
| 8565 | |
| 8566 | /* UnitDelay: '<S400>/FixPt Unit Delay2' */ |
| 8567 | L4_MABX_B.FixPtUnitDelay2_b = L4_MABX_DW.FixPtUnitDelay2_DSTATE_aq; |
| 8568 | |
| 8569 | /* UnitDelay: '<S400>/FixPt Unit Delay1' */ |
| 8570 | L4_MABX_B.Xold_h = L4_MABX_DW.FixPtUnitDelay1_DSTATE_h; |
| 8571 | |
| 8572 | /* Switch: '<S400>/Init' */ |
| 8573 | if (L4_MABX_B.FixPtUnitDelay2_b != 0) { |
| 8574 | L4_MABX_B.Init_ip = L4_MABX_B.If_Then_Else4_h.Switch; |
| 8575 | } else { |
| 8576 | L4_MABX_B.Init_ip = L4_MABX_B.Xold_h; |
| 8577 | } |
| 8578 | |
| 8579 | /* End of Switch: '<S400>/Init' */ |
| 8580 | |
| 8581 | /* Abs: '<S396>/Abs' incorporates: |
| 8582 | * Constant: '<S353>/STABILITY_CTRL_SLEW_INC_APV' |
| 8583 | */ |
| 8584 | L4_MABX_B.Abs_e = fabs(L4_MABX_P.STABILITY_CTRL_SLEW_INC_APV_Val); |
| 8585 | |
| 8586 | /* DigitalClock: '<S397>/Digital Clock' */ |
| 8587 | L4_MABX_B.DigitalClock = L4_MABX_M->Timing.t[0]; |
| 8588 | |
| 8589 | /* UnitDelay: '<S397>/Unit_Delay' */ |
| 8590 | L4_MABX_B.Unit_Delay_d = L4_MABX_DW.Unit_Delay_DSTATE_m; |
| 8591 | |
| 8592 | /* Sum: '<S397>/Subtract' */ |
| 8593 | L4_MABX_B.Subtract_l = L4_MABX_B.DigitalClock - L4_MABX_B.Unit_Delay_d; |
| 8594 | |
| 8595 | /* Product: '<S396>/Product1' */ |
| 8596 | L4_MABX_B.Product1_hp = L4_MABX_B.Abs_e * L4_MABX_B.Subtract_l; |
| 8597 | |
| 8598 | /* Sum: '<S396>/Add1' */ |
| 8599 | L4_MABX_B.Add1_n = L4_MABX_B.Init_ip + L4_MABX_B.Product1_hp; |
| 8600 | |
| 8601 | /* MinMax: '<S396>/MinMax2' */ |
| 8602 | DeltaTime = L4_MABX_B.If_Then_Else4_h.Switch; |
| 8603 | PositionFinalLimited = L4_MABX_B.Add1_n; |
| 8604 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8605 | PositionFinalLimited = DeltaTime; |
| 8606 | } |
| 8607 | |
| 8608 | L4_MABX_B.MinMax2_g = PositionFinalLimited; |
| 8609 | |
| 8610 | /* End of MinMax: '<S396>/MinMax2' */ |
| 8611 | |
| 8612 | /* Abs: '<S396>/Abs1' incorporates: |
| 8613 | * Constant: '<S353>/STABILITY_CTRL_SLEW_DEC_APV' |
| 8614 | */ |
| 8615 | L4_MABX_B.Abs1_h = fabs(L4_MABX_P.STABILITY_CTRL_SLEW_DEC_APV_Val); |
| 8616 | |
| 8617 | /* Product: '<S396>/Product2' */ |
| 8618 | L4_MABX_B.Product2_c = L4_MABX_B.Subtract_l * L4_MABX_B.Abs1_h; |
| 8619 | |
| 8620 | /* Sum: '<S396>/Subtract1' */ |
| 8621 | L4_MABX_B.Subtract1_n = L4_MABX_B.Init_ip - L4_MABX_B.Product2_c; |
| 8622 | |
| 8623 | /* MinMax: '<S396>/MinMax1' */ |
| 8624 | DeltaTime = L4_MABX_B.MinMax2_g; |
| 8625 | PositionFinalLimited = L4_MABX_B.Subtract1_n; |
| 8626 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8627 | PositionFinalLimited = DeltaTime; |
| 8628 | } |
| 8629 | |
| 8630 | L4_MABX_B.MinMax1_h = PositionFinalLimited; |
| 8631 | |
| 8632 | /* End of MinMax: '<S396>/MinMax1' */ |
| 8633 | |
| 8634 | /* Outputs for Atomic SubSystem: '<S396>/If_Then_Else' */ |
| 8635 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_ao, L4_MABX_B.MinMax_d, |
| 8636 | L4_MABX_B.MinMax1_h, &L4_MABX_B.If_Then_Else_m4); |
| 8637 | |
| 8638 | /* End of Outputs for SubSystem: '<S396>/If_Then_Else' */ |
| 8639 | |
| 8640 | /* RelationalOperator: '<S381>/Compare' incorporates: |
| 8641 | * Constant: '<S381>/Constant' |
| 8642 | */ |
| 8643 | L4_MABX_B.Compare_d = (L4_MABX_B.ACCDistanceAlertSignal == |
| 8644 | L4_MABX_P.CompareToConstant3_const); |
| 8645 | |
| 8646 | /* RelationalOperator: '<S382>/Compare' incorporates: |
| 8647 | * Constant: '<S382>/Constant' |
| 8648 | */ |
| 8649 | L4_MABX_B.Compare_dv = (L4_MABX_B.ForwardCollisionWarning == |
| 8650 | L4_MABX_P.CompareToConstant8_const); |
| 8651 | |
| 8652 | /* Logic: '<S351>/Logical Operator1' */ |
| 8653 | L4_MABX_B.LogicalOperator1_gm = (L4_MABX_B.Compare_d || L4_MABX_B.Compare_dv); |
| 8654 | |
| 8655 | /* UnitDelay: '<S384>/Unit_Delay' */ |
| 8656 | L4_MABX_B.Unit_Delay_hz = L4_MABX_DW.Unit_Delay_DSTATE_iy; |
| 8657 | |
| 8658 | /* Logic: '<S384>/Logical Operator1' */ |
| 8659 | L4_MABX_B.LogicalOperator1_jp = !L4_MABX_B.Unit_Delay_hz; |
| 8660 | |
| 8661 | /* Logic: '<S384>/Logical Operator' */ |
| 8662 | L4_MABX_B.LogicalOperator_kf = (L4_MABX_B.LogicalOperator1_gm && |
| 8663 | L4_MABX_B.LogicalOperator1_jp); |
| 8664 | |
| 8665 | /* UnitDelay: '<S385>/Unit_Delay' */ |
| 8666 | L4_MABX_B.Unit_Delay_c = L4_MABX_DW.Unit_Delay_DSTATE_mv; |
| 8667 | |
| 8668 | /* Logic: '<S385>/Logical Operator1' */ |
| 8669 | L4_MABX_B.LogicalOperator1_l4 = (L4_MABX_B.LogicalOperator_kf || |
| 8670 | L4_MABX_B.Unit_Delay_c); |
| 8671 | |
| 8672 | /* UnitDelay: '<S351>/Unit_Delay' */ |
| 8673 | L4_MABX_B.Unit_Delay_n = L4_MABX_DW.Unit_Delay_DSTATE_g; |
| 8674 | |
| 8675 | /* MinMax: '<S351>/MinMax' */ |
| 8676 | DeltaTime = L4_MABX_B.Unit_Delay_n; |
| 8677 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_gd; |
| 8678 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8679 | PositionFinalLimited = DeltaTime; |
| 8680 | } |
| 8681 | |
| 8682 | L4_MABX_B.MinMax_nx = PositionFinalLimited; |
| 8683 | |
| 8684 | /* End of MinMax: '<S351>/MinMax' */ |
| 8685 | |
| 8686 | /* Outputs for Atomic SubSystem: '<S351>/If_Then_Else4' */ |
| 8687 | |
| 8688 | /* Constant: '<S351>/FCW_ACTIVE_VSPD_TARGET_APV' incorporates: |
| 8689 | * Constant: '<S351>/Constant4' |
| 8690 | */ |
| 8691 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_gm, |
| 8692 | L4_MABX_P.FCW_ACTIVE_VSPD_TARGET_APV_Valu, |
| 8693 | L4_MABX_P.Constant4_Value_b, &L4_MABX_B.If_Then_Else4_e); |
| 8694 | |
| 8695 | /* End of Outputs for SubSystem: '<S351>/If_Then_Else4' */ |
| 8696 | |
| 8697 | /* UnitDelay: '<S389>/FixPt Unit Delay2' */ |
| 8698 | L4_MABX_B.FixPtUnitDelay2_p = L4_MABX_DW.FixPtUnitDelay2_DSTATE_ip; |
| 8699 | |
| 8700 | /* UnitDelay: '<S389>/FixPt Unit Delay1' */ |
| 8701 | L4_MABX_B.Xold_f = L4_MABX_DW.FixPtUnitDelay1_DSTATE_hq; |
| 8702 | |
| 8703 | /* Switch: '<S389>/Init' */ |
| 8704 | if (L4_MABX_B.FixPtUnitDelay2_p != 0) { |
| 8705 | L4_MABX_B.Init_b = L4_MABX_B.If_Then_Else4_e.Switch; |
| 8706 | } else { |
| 8707 | L4_MABX_B.Init_b = L4_MABX_B.Xold_f; |
| 8708 | } |
| 8709 | |
| 8710 | /* End of Switch: '<S389>/Init' */ |
| 8711 | |
| 8712 | /* Abs: '<S385>/Abs' incorporates: |
| 8713 | * Constant: '<S351>/FCW_CTRL_SLEW_INC_APV' |
| 8714 | */ |
| 8715 | L4_MABX_B.Abs_ez = fabs(L4_MABX_P.FCW_CTRL_SLEW_INC_APV_Value); |
| 8716 | |
| 8717 | /* DigitalClock: '<S386>/Digital Clock' */ |
| 8718 | L4_MABX_B.DigitalClock_b = L4_MABX_M->Timing.t[0]; |
| 8719 | |
| 8720 | /* UnitDelay: '<S386>/Unit_Delay' */ |
| 8721 | L4_MABX_B.Unit_Delay_nx = L4_MABX_DW.Unit_Delay_DSTATE_b; |
| 8722 | |
| 8723 | /* Sum: '<S386>/Subtract' */ |
| 8724 | L4_MABX_B.Subtract_i = L4_MABX_B.DigitalClock_b - L4_MABX_B.Unit_Delay_nx; |
| 8725 | |
| 8726 | /* Product: '<S385>/Product1' */ |
| 8727 | L4_MABX_B.Product1_i = L4_MABX_B.Abs_ez * L4_MABX_B.Subtract_i; |
| 8728 | |
| 8729 | /* Sum: '<S385>/Add1' */ |
| 8730 | L4_MABX_B.Add1_b = L4_MABX_B.Init_b + L4_MABX_B.Product1_i; |
| 8731 | |
| 8732 | /* MinMax: '<S385>/MinMax2' */ |
| 8733 | DeltaTime = L4_MABX_B.If_Then_Else4_e.Switch; |
| 8734 | PositionFinalLimited = L4_MABX_B.Add1_b; |
| 8735 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8736 | PositionFinalLimited = DeltaTime; |
| 8737 | } |
| 8738 | |
| 8739 | L4_MABX_B.MinMax2_k = PositionFinalLimited; |
| 8740 | |
| 8741 | /* End of MinMax: '<S385>/MinMax2' */ |
| 8742 | |
| 8743 | /* Abs: '<S385>/Abs1' incorporates: |
| 8744 | * Constant: '<S351>/FCW_CTRL_SLEW_DEC_APV' |
| 8745 | */ |
| 8746 | L4_MABX_B.Abs1_c = fabs(L4_MABX_P.FCW_CTRL_SLEW_DEC_APV_Value); |
| 8747 | |
| 8748 | /* Product: '<S385>/Product2' */ |
| 8749 | L4_MABX_B.Product2_n = L4_MABX_B.Subtract_i * L4_MABX_B.Abs1_c; |
| 8750 | |
| 8751 | /* Sum: '<S385>/Subtract1' */ |
| 8752 | L4_MABX_B.Subtract1_h = L4_MABX_B.Init_b - L4_MABX_B.Product2_n; |
| 8753 | |
| 8754 | /* MinMax: '<S385>/MinMax1' */ |
| 8755 | DeltaTime = L4_MABX_B.MinMax2_k; |
| 8756 | PositionFinalLimited = L4_MABX_B.Subtract1_h; |
| 8757 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8758 | PositionFinalLimited = DeltaTime; |
| 8759 | } |
| 8760 | |
| 8761 | L4_MABX_B.MinMax1_jm = PositionFinalLimited; |
| 8762 | |
| 8763 | /* End of MinMax: '<S385>/MinMax1' */ |
| 8764 | |
| 8765 | /* Outputs for Atomic SubSystem: '<S385>/If_Then_Else' */ |
| 8766 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_l4, L4_MABX_B.MinMax_nx, |
| 8767 | L4_MABX_B.MinMax1_jm, &L4_MABX_B.If_Then_Else_bf); |
| 8768 | |
| 8769 | /* End of Outputs for SubSystem: '<S385>/If_Then_Else' */ |
| 8770 | |
| 8771 | /* RateTransition: '<S81>/TmpRTBAtSignal Conversion3Inport1' */ |
| 8772 | if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) { |
| 8773 | L4_MABX_B.pathSpdLimit_a = L4_MABX_DW.TmpRTBAtSignalConversion3Inport; |
| 8774 | } |
| 8775 | |
| 8776 | /* MultiPortSwitch: '<S81>/Multiport Switch' incorporates: |
| 8777 | * Constant: '<S81>/LONG_SPEED_SRC_SELECTOR_APV' |
| 8778 | */ |
| 8779 | switch (LONG_SPEED_SRC_SELECTOR_APV) { |
| 8780 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH: |
| 8781 | /* SignalConversion: '<S81>/Signal Conversion3' */ |
| 8782 | L4_MABX_B.Vehicle_speed_abs_max_e = L4_MABX_B.pathSpdLimit_a; |
| 8783 | L4_MABX_B.Vehicle_speed_abs_max = L4_MABX_B.Vehicle_speed_abs_max_e; |
| 8784 | break; |
| 8785 | |
| 8786 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE: |
| 8787 | /* SignalConversion: '<S81>/Signal Conversion8' incorporates: |
| 8788 | * Constant: '<S81>/VSPD_ABS_MAX_APV' |
| 8789 | */ |
| 8790 | L4_MABX_B.Vehicle_speed_abs_max_j = L4_MABX_P.VSPD_ABS_MAX_APV_Value; |
| 8791 | L4_MABX_B.Vehicle_speed_abs_max = L4_MABX_B.Vehicle_speed_abs_max_j; |
| 8792 | break; |
| 8793 | |
| 8794 | default: |
| 8795 | /* SignalConversion: '<S81>/Signal Conversion15' incorporates: |
| 8796 | * Constant: '<S81>/CPV1' |
| 8797 | */ |
| 8798 | L4_MABX_B.Vehicle_speed_abs_max_g = L4_MABX_P.CPV1_Value; |
| 8799 | L4_MABX_B.Vehicle_speed_abs_max = L4_MABX_B.Vehicle_speed_abs_max_g; |
| 8800 | break; |
| 8801 | } |
| 8802 | |
| 8803 | /* RelationalOperator: '<S347>/Compare' incorporates: |
| 8804 | * Constant: '<S347>/Constant' |
| 8805 | */ |
| 8806 | L4_MABX_B.Compare_jr = (L4_MABX_B.SFunction1_o7_g == |
| 8807 | L4_MABX_P.Constant_Value_a); |
| 8808 | |
| 8809 | /* RateTransition: '<S81>/TmpRTBAtSignal Conversion2Inport1' */ |
| 8810 | if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) { |
| 8811 | L4_MABX_B.distance_o = L4_MABX_DW.TmpRTBAtSignalConversion2Inport; |
| 8812 | } |
| 8813 | |
| 8814 | /* MultiPortSwitch: '<S81>/Multiport Switch' incorporates: |
| 8815 | * Constant: '<S81>/LONG_SPEED_SRC_SELECTOR_APV' |
| 8816 | */ |
| 8817 | switch (LONG_SPEED_SRC_SELECTOR_APV) { |
| 8818 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH: |
| 8819 | /* SignalConversion: '<S81>/Signal Conversion2' */ |
| 8820 | L4_MABX_B.Distance_to_achieve_speed_tar_f = L4_MABX_B.distance_o; |
| 8821 | L4_MABX_B.Distance_to_achieve_speed_targe = |
| 8822 | L4_MABX_B.Distance_to_achieve_speed_tar_f; |
| 8823 | break; |
| 8824 | |
| 8825 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE: |
| 8826 | /* SignalConversion: '<S81>/Signal Conversion7' incorporates: |
| 8827 | * Constant: '<S81>/DISTANCE_M' |
| 8828 | */ |
| 8829 | L4_MABX_B.Distance_to_achieve_speed_tar_j = DISTANCE_M; |
| 8830 | L4_MABX_B.Distance_to_achieve_speed_targe = |
| 8831 | L4_MABX_B.Distance_to_achieve_speed_tar_j; |
| 8832 | break; |
| 8833 | |
| 8834 | default: |
| 8835 | /* SignalConversion: '<S81>/Signal Conversion14' incorporates: |
| 8836 | * Constant: '<S81>/CPV' |
| 8837 | */ |
| 8838 | L4_MABX_B.Distance_to_achieve_speed_tar_m = L4_MABX_P.CPV_Value_ia; |
| 8839 | L4_MABX_B.Distance_to_achieve_speed_targe = |
| 8840 | L4_MABX_B.Distance_to_achieve_speed_tar_m; |
| 8841 | break; |
| 8842 | } |
| 8843 | |
| 8844 | /* UnitDelay: '<S348>/Delay Input1' */ |
| 8845 | L4_MABX_B.Uk1[0] = L4_MABX_DW.DelayInput1_DSTATE[0]; |
| 8846 | L4_MABX_B.Uk1[1] = L4_MABX_DW.DelayInput1_DSTATE[1]; |
| 8847 | |
| 8848 | /* RelationalOperator: '<S348>/FixPt Relational Operator' */ |
| 8849 | L4_MABX_B.FixPtRelationalOperator_d[0] = |
| 8850 | (L4_MABX_B.Distance_to_achieve_speed_targe != L4_MABX_B.Uk1[0]); |
| 8851 | L4_MABX_B.FixPtRelationalOperator_d[1] = (L4_MABX_B.Vehicle_speed_target_o != |
| 8852 | L4_MABX_B.Uk1[1]); |
| 8853 | |
| 8854 | /* Logic: '<S81>/Logical Operator1' */ |
| 8855 | L4_MABX_B.LogicalOperator1_ja = (L4_MABX_B.FixPtRelationalOperator_d[0] || |
| 8856 | L4_MABX_B.FixPtRelationalOperator_d[1]); |
| 8857 | |
| 8858 | /* Saturate: '<S350>/Saturation5' */ |
| 8859 | DeltaTime = L4_MABX_B.SFunction1_o1_gd; |
| 8860 | Time56 = L4_MABX_P.Saturation5_LowerSat; |
| 8861 | AccelerationAverage = L4_MABX_P.Saturation5_UpperSat; |
| 8862 | if (DeltaTime > AccelerationAverage) { |
| 8863 | L4_MABX_B.Saturation5 = AccelerationAverage; |
| 8864 | } else if (DeltaTime < Time56) { |
| 8865 | L4_MABX_B.Saturation5 = Time56; |
| 8866 | } else { |
| 8867 | L4_MABX_B.Saturation5 = DeltaTime; |
| 8868 | } |
| 8869 | |
| 8870 | /* End of Saturate: '<S350>/Saturation5' */ |
| 8871 | |
| 8872 | /* MinMax: '<S350>/MinMax6' incorporates: |
| 8873 | * Constant: '<S350>/MIN_VSPD_SIGMOID_INITIAL_KPH_APV' |
| 8874 | */ |
| 8875 | DeltaTime = L4_MABX_B.Saturation5; |
| 8876 | PositionFinalLimited = L4_MABX_P.MIN_VSPD_SIGMOID_INITIAL_KPH_AP; |
| 8877 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8878 | PositionFinalLimited = DeltaTime; |
| 8879 | } |
| 8880 | |
| 8881 | L4_MABX_B.MinMax6 = PositionFinalLimited; |
| 8882 | |
| 8883 | /* End of MinMax: '<S350>/MinMax6' */ |
| 8884 | |
| 8885 | /* Gain: '<S350>/Gain1' */ |
| 8886 | L4_MABX_B.Gain1_e = L4_MABX_P.Gain1_Gain_a * L4_MABX_B.MinMax6; |
| 8887 | |
| 8888 | /* Saturate: '<S350>/Saturation4' */ |
| 8889 | DeltaTime = L4_MABX_B.Vehicle_speed_target_o; |
| 8890 | Time56 = L4_MABX_P.Saturation4_LowerSat; |
| 8891 | AccelerationAverage = L4_MABX_P.Saturation4_UpperSat; |
| 8892 | if (DeltaTime > AccelerationAverage) { |
| 8893 | L4_MABX_B.VSPD_TARGET_KPH_APV_gu = AccelerationAverage; |
| 8894 | } else if (DeltaTime < Time56) { |
| 8895 | L4_MABX_B.VSPD_TARGET_KPH_APV_gu = Time56; |
| 8896 | } else { |
| 8897 | L4_MABX_B.VSPD_TARGET_KPH_APV_gu = DeltaTime; |
| 8898 | } |
| 8899 | |
| 8900 | /* End of Saturate: '<S350>/Saturation4' */ |
| 8901 | |
| 8902 | /* MinMax: '<S350>/MinMax1' incorporates: |
| 8903 | * Constant: '<S350>/MIN_VSPD_SIGMOID_FINAL_KPH_APV' |
| 8904 | */ |
| 8905 | DeltaTime = L4_MABX_B.VSPD_TARGET_KPH_APV_gu; |
| 8906 | PositionFinalLimited = L4_MABX_P.MIN_VSPD_SIGMOID_FINAL_KPH_APV_; |
| 8907 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8908 | PositionFinalLimited = DeltaTime; |
| 8909 | } |
| 8910 | |
| 8911 | L4_MABX_B.MinMax1_f = PositionFinalLimited; |
| 8912 | |
| 8913 | /* End of MinMax: '<S350>/MinMax1' */ |
| 8914 | |
| 8915 | /* Gain: '<S350>/Gain2' */ |
| 8916 | L4_MABX_B.Gain2 = L4_MABX_P.Gain2_Gain_k * L4_MABX_B.MinMax1_f; |
| 8917 | |
| 8918 | /* Saturate: '<S350>/Saturation6' */ |
| 8919 | DeltaTime = SPN1810_LongitudinalAcceleration; |
| 8920 | Time56 = L4_MABX_P.Saturation6_LowerSat; |
| 8921 | AccelerationAverage = L4_MABX_P.Saturation6_UpperSat; |
| 8922 | if (DeltaTime > AccelerationAverage) { |
| 8923 | L4_MABX_B.Saturation6 = AccelerationAverage; |
| 8924 | } else if (DeltaTime < Time56) { |
| 8925 | L4_MABX_B.Saturation6 = Time56; |
| 8926 | } else { |
| 8927 | L4_MABX_B.Saturation6 = DeltaTime; |
| 8928 | } |
| 8929 | |
| 8930 | /* End of Saturate: '<S350>/Saturation6' */ |
| 8931 | |
| 8932 | /* MultiPortSwitch: '<S81>/Multiport Switch' incorporates: |
| 8933 | * Constant: '<S81>/LONG_SPEED_SRC_SELECTOR_APV' |
| 8934 | */ |
| 8935 | switch (LONG_SPEED_SRC_SELECTOR_APV) { |
| 8936 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH: |
| 8937 | /* SignalConversion: '<S81>/Signal Conversion10' incorporates: |
| 8938 | * Constant: '<S81>/CPV3' |
| 8939 | */ |
| 8940 | L4_MABX_B.Acceleration_target_ms2_d = L4_MABX_P.CPV3_Value_l; |
| 8941 | L4_MABX_B.Acceleration_target_ms2 = L4_MABX_B.Acceleration_target_ms2_d; |
| 8942 | break; |
| 8943 | |
| 8944 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE: |
| 8945 | /* SignalConversion: '<S81>/Signal Conversion5' incorporates: |
| 8946 | * Constant: '<S81>/VEH_ACCEL_TARGET_APV' |
| 8947 | */ |
| 8948 | L4_MABX_B.Acceleration_target_ms2_h = L4_MABX_P.VEH_ACCEL_TARGET_APV_Value; |
| 8949 | L4_MABX_B.Acceleration_target_ms2 = L4_MABX_B.Acceleration_target_ms2_h; |
| 8950 | break; |
| 8951 | |
| 8952 | default: |
| 8953 | /* SignalConversion: '<S81>/Signal Conversion11' incorporates: |
| 8954 | * Constant: '<S81>/CPV2' |
| 8955 | */ |
| 8956 | L4_MABX_B.Acceleration_target_ms2_f = L4_MABX_P.CPV2_Value; |
| 8957 | L4_MABX_B.Acceleration_target_ms2 = L4_MABX_B.Acceleration_target_ms2_f; |
| 8958 | break; |
| 8959 | } |
| 8960 | |
| 8961 | /* Saturate: '<S350>/Saturation7' */ |
| 8962 | DeltaTime = L4_MABX_B.Acceleration_target_ms2; |
| 8963 | Time56 = L4_MABX_P.Saturation7_LowerSat; |
| 8964 | AccelerationAverage = L4_MABX_P.Saturation7_UpperSat; |
| 8965 | if (DeltaTime > AccelerationAverage) { |
| 8966 | L4_MABX_B.Saturation7 = AccelerationAverage; |
| 8967 | } else if (DeltaTime < Time56) { |
| 8968 | L4_MABX_B.Saturation7 = Time56; |
| 8969 | } else { |
| 8970 | L4_MABX_B.Saturation7 = DeltaTime; |
| 8971 | } |
| 8972 | |
| 8973 | /* End of Saturate: '<S350>/Saturation7' */ |
| 8974 | |
| 8975 | /* Saturate: '<S350>/Saturation1' incorporates: |
| 8976 | * Constant: '<S81>/VEH_JERK_INITIAL_APV' |
| 8977 | */ |
| 8978 | DeltaTime = L4_MABX_P.VEH_JERK_INITIAL_APV_Value; |
| 8979 | Time56 = L4_MABX_P.Saturation1_LowerSat_b; |
| 8980 | AccelerationAverage = L4_MABX_P.Saturation1_UpperSat_o; |
| 8981 | if (DeltaTime > AccelerationAverage) { |
| 8982 | L4_MABX_B.Saturation1 = AccelerationAverage; |
| 8983 | } else if (DeltaTime < Time56) { |
| 8984 | L4_MABX_B.Saturation1 = Time56; |
| 8985 | } else { |
| 8986 | L4_MABX_B.Saturation1 = DeltaTime; |
| 8987 | } |
| 8988 | |
| 8989 | /* End of Saturate: '<S350>/Saturation1' */ |
| 8990 | |
| 8991 | /* MultiPortSwitch: '<S81>/Multiport Switch' incorporates: |
| 8992 | * Constant: '<S81>/LONG_SPEED_SRC_SELECTOR_APV' |
| 8993 | */ |
| 8994 | switch (LONG_SPEED_SRC_SELECTOR_APV) { |
| 8995 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH: |
| 8996 | /* SignalConversion: '<S81>/Signal Conversion13' incorporates: |
| 8997 | * Constant: '<S81>/CPV4' |
| 8998 | */ |
| 8999 | L4_MABX_B.Jerk_target_ms3_g = L4_MABX_P.CPV4_Value_k; |
| 9000 | L4_MABX_B.Jerk_target_ms3 = L4_MABX_B.Jerk_target_ms3_g; |
| 9001 | break; |
| 9002 | |
| 9003 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE: |
| 9004 | /* SignalConversion: '<S81>/Signal Conversion6' incorporates: |
| 9005 | * Constant: '<S81>/VEH_JERK_TARGET_APV' |
| 9006 | */ |
| 9007 | L4_MABX_B.Jerk_target_ms3_d = L4_MABX_P.VEH_JERK_TARGET_APV_Value; |
| 9008 | L4_MABX_B.Jerk_target_ms3 = L4_MABX_B.Jerk_target_ms3_d; |
| 9009 | break; |
| 9010 | |
| 9011 | default: |
| 9012 | /* SignalConversion: '<S81>/Signal Conversion12' incorporates: |
| 9013 | * Constant: '<S81>/CPV5' |
| 9014 | */ |
| 9015 | L4_MABX_B.Jerk_target_ms3_l = L4_MABX_P.CPV5_Value_n; |
| 9016 | L4_MABX_B.Jerk_target_ms3 = L4_MABX_B.Jerk_target_ms3_l; |
| 9017 | break; |
| 9018 | } |
| 9019 | |
| 9020 | /* Saturate: '<S350>/Saturation2' */ |
| 9021 | DeltaTime = L4_MABX_B.Jerk_target_ms3; |
| 9022 | Time56 = L4_MABX_P.Saturation2_LowerSat; |
| 9023 | AccelerationAverage = L4_MABX_P.Saturation2_UpperSat; |
| 9024 | if (DeltaTime > AccelerationAverage) { |
| 9025 | L4_MABX_B.Saturation2 = AccelerationAverage; |
| 9026 | } else if (DeltaTime < Time56) { |
| 9027 | L4_MABX_B.Saturation2 = Time56; |
| 9028 | } else { |
| 9029 | L4_MABX_B.Saturation2 = DeltaTime; |
| 9030 | } |
| 9031 | |
| 9032 | /* End of Saturate: '<S350>/Saturation2' */ |
| 9033 | |
| 9034 | /* Chart: '<S350>/VehicleSpeedSetpointDynamicCalculation' */ |
| 9035 | /* Gateway: Controller/L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/VehicleSpeedSetpointDynamicCalculation */ |
| 9036 | /* During: Controller/L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/VehicleSpeedSetpointDynamicCalculation */ |
| 9037 | /* Entry Internal: Controller/L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/VehicleSpeedSetpointDynamicCalculation */ |
| 9038 | /* Transition: '<S365>:88' */ |
| 9039 | if (L4_MABX_B.LogicalOperator1_ja) { |
| 9040 | /* Transition: '<S365>:89' */ |
| 9041 | /* Transition: '<S365>:39' */ |
| 9042 | PositionFinalLimited = L4_MABX_B.Distance_to_achieve_speed_targe; |
| 9043 | if ((0.001 > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 9044 | PositionFinalLimited = 0.001; |
| 9045 | } |
| 9046 | |
| 9047 | Time56 = L4_MABX_B.Gain1_e; |
| 9048 | if ((0.1 > Time56) || rtIsNaN(Time56)) { |
| 9049 | L4_MABX_DW.VelocityInitialLimited = 0.1; |
| 9050 | } else { |
| 9051 | L4_MABX_DW.VelocityInitialLimited = Time56; |
| 9052 | } |
| 9053 | |
| 9054 | Time56 = L4_MABX_B.Gain2; |
| 9055 | if ((0.1 > Time56) || rtIsNaN(Time56)) { |
| 9056 | L4_MABX_DW.VelocityFinalLimited = 0.1; |
| 9057 | } else { |
| 9058 | L4_MABX_DW.VelocityFinalLimited = Time56; |
| 9059 | } |
| 9060 | |
| 9061 | L4_MABX_DW.TimeFinal = 2.0 * PositionFinalLimited / |
| 9062 | (L4_MABX_DW.VelocityInitialLimited + L4_MABX_DW.VelocityFinalLimited); |
| 9063 | Time56 = L4_MABX_DW.TimeFinal; |
| 9064 | if ((0.007 > Time56) || rtIsNaN(Time56)) { |
| 9065 | L4_MABX_DW.TimeFinal = 0.007; |
| 9066 | } else { |
| 9067 | L4_MABX_DW.TimeFinal = Time56; |
| 9068 | } |
| 9069 | |
| 9070 | AccelerationAverage = (L4_MABX_DW.VelocityFinalLimited - |
| 9071 | L4_MABX_DW.VelocityInitialLimited) / L4_MABX_DW.TimeFinal; |
| 9072 | L4_MABX_DW.TimeFinal *= 2.0; |
| 9073 | if (L4_MABX_DW.VelocityFinalLimited > L4_MABX_DW.VelocityInitialLimited) { |
| 9074 | /* Transition: '<S365>:238' */ |
| 9075 | /* Transition: '<S365>:240' */ |
| 9076 | Time56 = L4_MABX_B.Saturation6; |
| 9077 | if ((AccelerationAverage < Time56) || rtIsNaN(Time56)) { |
| 9078 | Time56 = AccelerationAverage; |
| 9079 | } |
| 9080 | |
| 9081 | if ((0.0 > Time56) || rtIsNaN(Time56)) { |
| 9082 | L4_MABX_DW.AccelerationInitialLimited = 0.0; |
| 9083 | } else { |
| 9084 | L4_MABX_DW.AccelerationInitialLimited = Time56; |
| 9085 | } |
| 9086 | |
| 9087 | Time56 = L4_MABX_B.Saturation7; |
| 9088 | if ((AccelerationAverage < Time56) || rtIsNaN(Time56)) { |
| 9089 | Time56 = AccelerationAverage; |
| 9090 | } |
| 9091 | |
| 9092 | if ((0.0 > Time56) || rtIsNaN(Time56)) { |
| 9093 | L4_MABX_DW.AccelerationFinalLimited = 0.0; |
| 9094 | } else { |
| 9095 | L4_MABX_DW.AccelerationFinalLimited = Time56; |
| 9096 | } |
| 9097 | |
| 9098 | /* Transition: '<S365>:243' */ |
| 9099 | } else { |
| 9100 | /* Transition: '<S365>:241' */ |
| 9101 | Time56 = L4_MABX_B.Saturation6; |
| 9102 | if ((0.0 < Time56) || rtIsNaN(Time56)) { |
| 9103 | Time56 = 0.0; |
| 9104 | } |
| 9105 | |
| 9106 | if ((AccelerationAverage > Time56) || rtIsNaN(Time56)) { |
| 9107 | L4_MABX_DW.AccelerationInitialLimited = AccelerationAverage; |
| 9108 | } else { |
| 9109 | L4_MABX_DW.AccelerationInitialLimited = Time56; |
| 9110 | } |
| 9111 | |
| 9112 | Time56 = L4_MABX_B.Saturation7; |
| 9113 | if ((0.0 < Time56) || rtIsNaN(Time56)) { |
| 9114 | Time56 = 0.0; |
| 9115 | } |
| 9116 | |
| 9117 | if ((AccelerationAverage > Time56) || rtIsNaN(Time56)) { |
| 9118 | L4_MABX_DW.AccelerationFinalLimited = AccelerationAverage; |
| 9119 | } else { |
| 9120 | L4_MABX_DW.AccelerationFinalLimited = Time56; |
| 9121 | } |
| 9122 | } |
| 9123 | |
| 9124 | /* Transition: '<S365>:16' */ |
| 9125 | DeltaTimeFinal = L4_MABX_DW.TimeFinal; |
| 9126 | for (starting_index = 1U; starting_index < 16; starting_index++) { |
| 9127 | /* Transition: '<S365>:14' */ |
| 9128 | /* Transition: '<S365>:201' */ |
| 9129 | DeltaTime = ((L4_MABX_DW.VelocityInitialLimited - |
| 9130 | L4_MABX_DW.VelocityFinalLimited) + |
| 9131 | L4_MABX_DW.AccelerationFinalLimited * L4_MABX_DW.TimeFinal) * |
| 9132 | 2.0 / (L4_MABX_DW.TimeFinal * L4_MABX_DW.TimeFinal); |
| 9133 | if (L4_MABX_DW.VelocityFinalLimited > L4_MABX_DW.VelocityInitialLimited) { |
| 9134 | /* Transition: '<S365>:121' */ |
| 9135 | /* Transition: '<S365>:116' */ |
| 9136 | L4_MABX_DW.Jerk12 = L4_MABX_B.Saturation1; |
| 9137 | DeltaTime = fabs(DeltaTime); |
| 9138 | Time56 = L4_MABX_B.Saturation2; |
| 9139 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9140 | Time56 = DeltaTime; |
| 9141 | } |
| 9142 | |
| 9143 | L4_MABX_DW.Jerk56 = -Time56; |
| 9144 | |
| 9145 | /* Transition: '<S365>:120' */ |
| 9146 | } else { |
| 9147 | /* Transition: '<S365>:122' */ |
| 9148 | L4_MABX_DW.Jerk12 = -L4_MABX_B.Saturation1; |
| 9149 | DeltaTime = fabs(DeltaTime); |
| 9150 | Time56 = L4_MABX_B.Saturation2; |
| 9151 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9152 | L4_MABX_DW.Jerk56 = DeltaTime; |
| 9153 | } else { |
| 9154 | L4_MABX_DW.Jerk56 = Time56; |
| 9155 | } |
| 9156 | } |
| 9157 | |
| 9158 | /* Transition: '<S365>:275' */ |
| 9159 | L4_MABX_CalculateAcceleration34(); |
| 9160 | if (fabs(L4_MABX_DW.Acceleration34 - AccelerationAverage) < 0.001) { |
| 9161 | /* Transition: '<S365>:141' */ |
| 9162 | /* Transition: '<S365>:145' */ |
| 9163 | L4_MABX_B.TimeVectorRaw[0] = 0.0; |
| 9164 | L4_MABX_B.TimeVectorRaw[1] = 0.001; |
| 9165 | L4_MABX_B.TimeVectorRaw[2] = 0.003; |
| 9166 | L4_MABX_B.TimeVectorRaw[3] = (L4_MABX_DW.TimeFinal - 0.002) - 0.001; |
| 9167 | L4_MABX_B.TimeVectorRaw[4] = (L4_MABX_DW.TimeFinal - 0.002) + 0.001; |
| 9168 | L4_MABX_B.TimeVectorRaw[5] = L4_MABX_DW.TimeFinal; |
| 9169 | for (i = 0; i < 6; i++) { |
| 9170 | L4_MABX_B.JerkVectorRaw[i] = 0.0; |
| 9171 | } |
| 9172 | |
| 9173 | L4_MABX_B.AccelerationVectorRaw[0] = AccelerationAverage; |
| 9174 | |
| 9175 | /* Transition: '<S365>:191' */ |
| 9176 | /* Transition: '<S365>:303' */ |
| 9177 | } else { |
| 9178 | /* Transition: '<S365>:298' */ |
| 9179 | if (L4_MABX_DW.AlternateMethod) { |
| 9180 | /* Transition: '<S365>:300' */ |
| 9181 | /* Transition: '<S365>:302' */ |
| 9182 | Time56 = (L4_MABX_DW.AccelerationFinalLimited - |
| 9183 | L4_MABX_DW.Acceleration34) / L4_MABX_DW.Jerk56; |
| 9184 | if ((0.002 > Time56) || rtIsNaN(Time56)) { |
| 9185 | Time56 = 0.002; |
| 9186 | } |
| 9187 | |
| 9188 | L4_MABX_B.TimeVectorRaw[0] = 0.0; |
| 9189 | L4_MABX_B.TimeVectorRaw[1] = 0.001; |
| 9190 | L4_MABX_B.TimeVectorRaw[2] = 0.003; |
| 9191 | L4_MABX_B.TimeVectorRaw[3] = (L4_MABX_DW.TimeFinal - Time56) - 0.001; |
| 9192 | L4_MABX_B.TimeVectorRaw[4] = (L4_MABX_DW.TimeFinal - Time56) + 0.001; |
| 9193 | L4_MABX_B.TimeVectorRaw[5] = L4_MABX_DW.TimeFinal; |
| 9194 | L4_MABX_B.JerkVectorRaw[0] = 0.0; |
| 9195 | L4_MABX_B.JerkVectorRaw[1] = 0.0; |
| 9196 | L4_MABX_B.JerkVectorRaw[2] = 0.0; |
| 9197 | L4_MABX_B.JerkVectorRaw[3] = 0.0; |
| 9198 | L4_MABX_B.JerkVectorRaw[4] = L4_MABX_DW.Jerk56; |
| 9199 | L4_MABX_B.JerkVectorRaw[5] = L4_MABX_DW.Jerk56; |
| 9200 | L4_MABX_B.AccelerationVectorRaw[0] = L4_MABX_DW.Acceleration34; |
| 9201 | |
| 9202 | /* Transition: '<S365>:303' */ |
| 9203 | } else { |
| 9204 | /* Transition: '<S365>:157' */ |
| 9205 | DeltaTime = (L4_MABX_DW.Acceleration34 - |
| 9206 | L4_MABX_DW.AccelerationInitialLimited) / |
| 9207 | L4_MABX_DW.Jerk12; |
| 9208 | if ((0.002 > DeltaTime) || rtIsNaN(DeltaTime)) { |
| 9209 | DeltaTime = 0.002; |
| 9210 | } |
| 9211 | |
| 9212 | Time56 = (L4_MABX_DW.AccelerationFinalLimited - |
| 9213 | L4_MABX_DW.Acceleration34) / L4_MABX_DW.Jerk56; |
| 9214 | if ((0.002 > Time56) || rtIsNaN(Time56)) { |
| 9215 | Time56 = 0.002; |
| 9216 | } |
| 9217 | |
| 9218 | L4_MABX_B.TimeVectorRaw[0] = 0.0; |
| 9219 | L4_MABX_B.TimeVectorRaw[1] = DeltaTime - 0.001; |
| 9220 | L4_MABX_B.TimeVectorRaw[2] = DeltaTime + 0.001; |
| 9221 | L4_MABX_B.TimeVectorRaw[3] = (L4_MABX_DW.TimeFinal - Time56) - 0.001; |
| 9222 | L4_MABX_B.TimeVectorRaw[4] = (L4_MABX_DW.TimeFinal - Time56) + 0.001; |
| 9223 | L4_MABX_B.TimeVectorRaw[5] = L4_MABX_DW.TimeFinal; |
| 9224 | L4_MABX_B.JerkVectorRaw[0] = L4_MABX_DW.Jerk12; |
| 9225 | L4_MABX_B.JerkVectorRaw[1] = L4_MABX_DW.Jerk12; |
| 9226 | L4_MABX_B.JerkVectorRaw[2] = 0.0; |
| 9227 | L4_MABX_B.JerkVectorRaw[3] = 0.0; |
| 9228 | L4_MABX_B.JerkVectorRaw[4] = L4_MABX_DW.Jerk56; |
| 9229 | L4_MABX_B.JerkVectorRaw[5] = L4_MABX_DW.Jerk56; |
| 9230 | L4_MABX_B.AccelerationVectorRaw[0] = |
| 9231 | L4_MABX_DW.AccelerationInitialLimited; |
| 9232 | } |
| 9233 | } |
| 9234 | |
| 9235 | /* Transition: '<S365>:29' */ |
| 9236 | L4_MABX_B.VelocityVectorRaw[0] = L4_MABX_DW.VelocityInitialLimited; |
| 9237 | L4_MABX_B.PositionVectorRaw[0] = 0.0; |
| 9238 | for (j = 2U; j < 7; j++) { |
| 9239 | /* Transition: '<S365>:34' */ |
| 9240 | /* Transition: '<S365>:36' */ |
| 9241 | DeltaTime = L4_MABX_B.TimeVectorRaw[j - 1] - L4_MABX_B.TimeVectorRaw[j - |
| 9242 | 2]; |
| 9243 | L4_MABX_B.AccelerationVectorRaw[j - 1] = L4_MABX_B.JerkVectorRaw[j - 2] * |
| 9244 | DeltaTime + L4_MABX_B.AccelerationVectorRaw[j - 2]; |
| 9245 | L4_MABX_B.VelocityVectorRaw[j - 1] = (L4_MABX_B.AccelerationVectorRaw[j |
| 9246 | - 2] * DeltaTime + L4_MABX_B.VelocityVectorRaw[j - 2]) + |
| 9247 | L4_MABX_B.JerkVectorRaw[j - 2] * 0.5 * (DeltaTime * DeltaTime); |
| 9248 | L4_MABX_B.PositionVectorRaw[j - 1] = ((L4_MABX_B.VelocityVectorRaw[j - 2] |
| 9249 | * DeltaTime + L4_MABX_B.PositionVectorRaw[j - 2]) + |
| 9250 | L4_MABX_B.AccelerationVectorRaw[j - 2] * 0.5 * (DeltaTime * DeltaTime)) |
| 9251 | + L4_MABX_B.JerkVectorRaw[j - 2] / 6.0 * rt_powd_snf(DeltaTime, 3.0); |
| 9252 | |
| 9253 | /* Transition: '<S365>:33' */ |
| 9254 | } |
| 9255 | |
| 9256 | /* Transition: '<S365>:37' */ |
| 9257 | DeltaTimeFinal *= 0.5; |
| 9258 | if ((L4_MABX_B.PositionVectorRaw[5] - PositionFinalLimited < 0.0) && |
| 9259 | (L4_MABX_B.VelocityVectorRaw[5] > 0.0)) { |
| 9260 | /* Transition: '<S365>:61' */ |
| 9261 | /* Transition: '<S365>:62' */ |
| 9262 | L4_MABX_DW.TimeFinal += DeltaTimeFinal; |
| 9263 | |
| 9264 | /* Transition: '<S365>:64' */ |
| 9265 | } else { |
| 9266 | /* Transition: '<S365>:63' */ |
| 9267 | L4_MABX_DW.TimeFinal -= DeltaTimeFinal; |
| 9268 | } |
| 9269 | |
| 9270 | /* Transition: '<S365>:60' */ |
| 9271 | Time56 = L4_MABX_DW.TimeFinal; |
| 9272 | if ((0.007 > Time56) || rtIsNaN(Time56)) { |
| 9273 | L4_MABX_DW.TimeFinal = 0.007; |
| 9274 | } else { |
| 9275 | L4_MABX_DW.TimeFinal = Time56; |
| 9276 | } |
| 9277 | |
| 9278 | /* Transition: '<S365>:17' */ |
| 9279 | } |
| 9280 | |
| 9281 | /* Transition: '<S365>:18' */ |
| 9282 | /* Transition: '<S365>:91' */ |
| 9283 | } else { |
| 9284 | /* Transition: '<S365>:90' */ |
| 9285 | } |
| 9286 | |
| 9287 | /* End of Chart: '<S350>/VehicleSpeedSetpointDynamicCalculation' */ |
| 9288 | |
| 9289 | /* Chart: '<S350>/TwentyPointVectorCalculation' */ |
| 9290 | if (L4_MABX_B.LogicalOperator1_ja) { |
| 9291 | /* Transition: '<S364>:89' */ |
| 9292 | /* Transition: '<S364>:39' */ |
| 9293 | L4_MABX_B.TimeVector[0] = L4_MABX_B.TimeVectorRaw[0]; |
| 9294 | L4_MABX_B.JerkVector[0] = L4_MABX_B.JerkVectorRaw[0]; |
| 9295 | L4_MABX_B.AccelerationVector[0] = L4_MABX_B.AccelerationVectorRaw[0]; |
| 9296 | L4_MABX_B.VelocityVector[0] = L4_MABX_B.VelocityVectorRaw[0]; |
| 9297 | L4_MABX_B.PositionVector[0] = L4_MABX_B.PositionVectorRaw[0]; |
| 9298 | PositionFinalLimited = (L4_MABX_B.TimeVectorRaw[1] - |
| 9299 | L4_MABX_B.TimeVectorRaw[0]) / 10.0; |
| 9300 | for (starting_index = 2U; starting_index < 11; starting_index++) { |
| 9301 | /* Transition: '<S364>:14' */ |
| 9302 | /* Transition: '<S364>:101' */ |
| 9303 | L4_MABX_B.TimeVector[starting_index - 1] = |
| 9304 | L4_MABX_B.TimeVector[starting_index - 2] + PositionFinalLimited; |
| 9305 | DeltaTime = L4_MABX_B.TimeVector[starting_index - 1] - |
| 9306 | L4_MABX_B.TimeVectorRaw[0]; |
| 9307 | L4_MABX_B.JerkVector[starting_index - 1] = L4_MABX_B.JerkVectorRaw[0]; |
| 9308 | L4_MABX_B.AccelerationVector[starting_index - 1] = |
| 9309 | L4_MABX_B.JerkVectorRaw[0] * DeltaTime + |
| 9310 | L4_MABX_B.AccelerationVectorRaw[0]; |
| 9311 | L4_MABX_B.VelocityVector[starting_index - 1] = |
| 9312 | (L4_MABX_B.AccelerationVectorRaw[0] * DeltaTime + |
| 9313 | L4_MABX_B.VelocityVectorRaw[0]) + 0.5 * L4_MABX_B.JerkVectorRaw[0] * |
| 9314 | (DeltaTime * DeltaTime); |
| 9315 | L4_MABX_B.PositionVector[starting_index - 1] = |
| 9316 | ((L4_MABX_B.VelocityVectorRaw[0] * DeltaTime + |
| 9317 | L4_MABX_B.PositionVectorRaw[0]) + 0.5 * |
| 9318 | L4_MABX_B.AccelerationVectorRaw[0] * (DeltaTime * DeltaTime)) + |
| 9319 | L4_MABX_B.JerkVectorRaw[0] / 6.0 * rt_powd_snf(DeltaTime, 3.0); |
| 9320 | DeltaTime = L4_MABX_B.PositionVector[starting_index - 2] + 0.0001; |
| 9321 | Time56 = L4_MABX_B.PositionVector[starting_index - 1]; |
| 9322 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9323 | Time56 = DeltaTime; |
| 9324 | } |
| 9325 | |
| 9326 | L4_MABX_B.PositionVector[starting_index - 1] = Time56; |
| 9327 | |
| 9328 | /* Transition: '<S364>:17' */ |
| 9329 | } |
| 9330 | |
| 9331 | /* Transition: '<S364>:110' */ |
| 9332 | L4_MABX_B.TimeVector[10] = L4_MABX_B.TimeVectorRaw[1]; |
| 9333 | L4_MABX_B.JerkVector[10] = L4_MABX_B.JerkVectorRaw[1]; |
| 9334 | L4_MABX_B.AccelerationVector[10] = L4_MABX_B.AccelerationVectorRaw[1]; |
| 9335 | L4_MABX_B.VelocityVector[10] = L4_MABX_B.VelocityVectorRaw[1]; |
| 9336 | DeltaTime = L4_MABX_B.PositionVector[9] + 0.0001; |
| 9337 | Time56 = L4_MABX_B.PositionVectorRaw[1]; |
| 9338 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9339 | Time56 = DeltaTime; |
| 9340 | } |
| 9341 | |
| 9342 | L4_MABX_B.PositionVector[10] = Time56; |
| 9343 | L4_MABX_B.TimeVector[11] = L4_MABX_B.TimeVectorRaw[2]; |
| 9344 | L4_MABX_B.JerkVector[11] = L4_MABX_B.JerkVectorRaw[2]; |
| 9345 | L4_MABX_B.AccelerationVector[11] = L4_MABX_B.AccelerationVectorRaw[2]; |
| 9346 | L4_MABX_B.VelocityVector[11] = L4_MABX_B.VelocityVectorRaw[2]; |
| 9347 | DeltaTime = L4_MABX_B.PositionVector[10] + 0.0001; |
| 9348 | Time56 = L4_MABX_B.PositionVectorRaw[2]; |
| 9349 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9350 | Time56 = DeltaTime; |
| 9351 | } |
| 9352 | |
| 9353 | L4_MABX_B.PositionVector[11] = Time56; |
| 9354 | PositionFinalLimited = (L4_MABX_B.TimeVectorRaw[3] - |
| 9355 | L4_MABX_B.TimeVectorRaw[2]) / 10.0; |
| 9356 | for (starting_index = 13U; starting_index < 22; starting_index++) { |
| 9357 | /* Transition: '<S364>:127' */ |
| 9358 | /* Transition: '<S364>:133' */ |
| 9359 | L4_MABX_B.TimeVector[starting_index - 1] = |
| 9360 | L4_MABX_B.TimeVector[starting_index - 2] + PositionFinalLimited; |
| 9361 | DeltaTime = L4_MABX_B.TimeVector[starting_index - 1] - |
| 9362 | L4_MABX_B.TimeVectorRaw[2]; |
| 9363 | L4_MABX_B.JerkVector[starting_index - 1] = L4_MABX_B.JerkVectorRaw[2]; |
| 9364 | L4_MABX_B.AccelerationVector[starting_index - 1] = |
| 9365 | L4_MABX_B.JerkVectorRaw[2] * DeltaTime + |
| 9366 | L4_MABX_B.AccelerationVectorRaw[2]; |
| 9367 | L4_MABX_B.VelocityVector[starting_index - 1] = |
| 9368 | (L4_MABX_B.AccelerationVectorRaw[2] * DeltaTime + |
| 9369 | L4_MABX_B.VelocityVectorRaw[2]) + 0.5 * L4_MABX_B.JerkVectorRaw[2] * |
| 9370 | (DeltaTime * DeltaTime); |
| 9371 | L4_MABX_B.PositionVector[starting_index - 1] = |
| 9372 | ((L4_MABX_B.VelocityVectorRaw[2] * DeltaTime + |
| 9373 | L4_MABX_B.PositionVectorRaw[2]) + 0.5 * |
| 9374 | L4_MABX_B.AccelerationVectorRaw[2] * (DeltaTime * DeltaTime)) + |
| 9375 | L4_MABX_B.JerkVectorRaw[2] / 6.0 * rt_powd_snf(DeltaTime, 3.0); |
| 9376 | DeltaTime = L4_MABX_B.PositionVector[starting_index - 2] + 0.0001; |
| 9377 | Time56 = L4_MABX_B.PositionVector[starting_index - 1]; |
| 9378 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9379 | Time56 = DeltaTime; |
| 9380 | } |
| 9381 | |
| 9382 | L4_MABX_B.PositionVector[starting_index - 1] = Time56; |
| 9383 | |
| 9384 | /* Transition: '<S364>:131' */ |
| 9385 | } |
| 9386 | |
| 9387 | /* Transition: '<S364>:132' */ |
| 9388 | L4_MABX_B.TimeVector[21] = L4_MABX_B.TimeVectorRaw[3]; |
| 9389 | L4_MABX_B.JerkVector[21] = L4_MABX_B.JerkVectorRaw[3]; |
| 9390 | L4_MABX_B.AccelerationVector[21] = L4_MABX_B.AccelerationVectorRaw[3]; |
| 9391 | L4_MABX_B.VelocityVector[21] = L4_MABX_B.VelocityVectorRaw[3]; |
| 9392 | DeltaTime = L4_MABX_B.PositionVector[20] + 0.0001; |
| 9393 | Time56 = L4_MABX_B.PositionVectorRaw[3]; |
| 9394 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9395 | Time56 = DeltaTime; |
| 9396 | } |
| 9397 | |
| 9398 | L4_MABX_B.PositionVector[21] = Time56; |
| 9399 | L4_MABX_B.TimeVector[22] = L4_MABX_B.TimeVectorRaw[4]; |
| 9400 | L4_MABX_B.JerkVector[22] = L4_MABX_B.JerkVectorRaw[4]; |
| 9401 | L4_MABX_B.AccelerationVector[22] = L4_MABX_B.AccelerationVectorRaw[4]; |
| 9402 | L4_MABX_B.VelocityVector[22] = L4_MABX_B.VelocityVectorRaw[4]; |
| 9403 | DeltaTime = L4_MABX_B.PositionVector[21] + 0.0001; |
| 9404 | Time56 = L4_MABX_B.PositionVectorRaw[4]; |
| 9405 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9406 | Time56 = DeltaTime; |
| 9407 | } |
| 9408 | |
| 9409 | L4_MABX_B.PositionVector[22] = Time56; |
| 9410 | PositionFinalLimited = (L4_MABX_B.TimeVectorRaw[5] - |
| 9411 | L4_MABX_B.TimeVectorRaw[4]) / 10.0; |
| 9412 | for (starting_index = 24U; starting_index < 33; starting_index++) { |
| 9413 | /* Transition: '<S364>:111' */ |
| 9414 | /* Transition: '<S364>:113' */ |
| 9415 | L4_MABX_B.TimeVector[starting_index - 1] = |
| 9416 | L4_MABX_B.TimeVector[starting_index - 2] + PositionFinalLimited; |
| 9417 | DeltaTime = L4_MABX_B.TimeVector[starting_index - 1] - |
| 9418 | L4_MABX_B.TimeVectorRaw[4]; |
| 9419 | L4_MABX_B.JerkVector[starting_index - 1] = L4_MABX_B.JerkVectorRaw[4]; |
| 9420 | L4_MABX_B.AccelerationVector[starting_index - 1] = |
| 9421 | L4_MABX_B.JerkVectorRaw[4] * DeltaTime + |
| 9422 | L4_MABX_B.AccelerationVectorRaw[4]; |
| 9423 | L4_MABX_B.VelocityVector[starting_index - 1] = |
| 9424 | (L4_MABX_B.AccelerationVectorRaw[4] * DeltaTime + |
| 9425 | L4_MABX_B.VelocityVectorRaw[4]) + 0.5 * L4_MABX_B.JerkVectorRaw[4] * |
| 9426 | (DeltaTime * DeltaTime); |
| 9427 | L4_MABX_B.PositionVector[starting_index - 1] = |
| 9428 | ((L4_MABX_B.VelocityVectorRaw[4] * DeltaTime + |
| 9429 | L4_MABX_B.PositionVectorRaw[4]) + 0.5 * |
| 9430 | L4_MABX_B.AccelerationVectorRaw[4] * (DeltaTime * DeltaTime)) + |
| 9431 | L4_MABX_B.JerkVectorRaw[4] / 6.0 * rt_powd_snf(DeltaTime, 3.0); |
| 9432 | DeltaTime = L4_MABX_B.PositionVector[starting_index - 2] + 0.0001; |
| 9433 | Time56 = L4_MABX_B.PositionVector[starting_index - 1]; |
| 9434 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9435 | Time56 = DeltaTime; |
| 9436 | } |
| 9437 | |
| 9438 | L4_MABX_B.PositionVector[starting_index - 1] = Time56; |
| 9439 | |
| 9440 | /* Transition: '<S364>:112' */ |
| 9441 | } |
| 9442 | |
| 9443 | /* Transition: '<S364>:114' */ |
| 9444 | L4_MABX_B.TimeVector[32] = L4_MABX_B.TimeVectorRaw[5]; |
| 9445 | L4_MABX_B.JerkVector[32] = L4_MABX_B.JerkVectorRaw[5]; |
| 9446 | L4_MABX_B.AccelerationVector[32] = L4_MABX_B.AccelerationVectorRaw[5]; |
| 9447 | L4_MABX_B.VelocityVector[32] = L4_MABX_B.VelocityVectorRaw[5]; |
| 9448 | DeltaTime = L4_MABX_B.PositionVector[31] + 0.0001; |
| 9449 | Time56 = L4_MABX_B.PositionVectorRaw[5]; |
| 9450 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9451 | Time56 = DeltaTime; |
| 9452 | } |
| 9453 | |
| 9454 | L4_MABX_B.PositionVector[32] = Time56; |
| 9455 | |
| 9456 | /* Transition: '<S364>:141' */ |
| 9457 | } else { |
| 9458 | /* Transition: '<S364>:90' */ |
| 9459 | } |
| 9460 | |
| 9461 | /* End of Chart: '<S350>/TwentyPointVectorCalculation' */ |
| 9462 | |
| 9463 | /* Gain: '<S350>/Gain3' */ |
| 9464 | /* Transition: '<S365>:93' */ |
| 9465 | /* Gateway: Controller/L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/TwentyPointVectorCalculation */ |
| 9466 | /* During: Controller/L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/TwentyPointVectorCalculation */ |
| 9467 | /* Entry Internal: Controller/L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/TwentyPointVectorCalculation */ |
| 9468 | /* Transition: '<S364>:88' */ |
| 9469 | /* Transition: '<S364>:93' */ |
| 9470 | for (i = 0; i < 33; i++) { |
| 9471 | L4_MABX_B.Vehicle_speed_vector_kph[i] = L4_MABX_P.Gain3_Gain_l * |
| 9472 | L4_MABX_B.VelocityVector[i]; |
| 9473 | } |
| 9474 | |
| 9475 | /* End of Gain: '<S350>/Gain3' */ |
| 9476 | |
| 9477 | /* RelationalOperator: '<S367>/Compare' incorporates: |
| 9478 | * Constant: '<S367>/Constant' |
| 9479 | */ |
| 9480 | for (i = 0; i < 33; i++) { |
| 9481 | L4_MABX_B.Compare_nk[i] = (L4_MABX_B.Vehicle_speed_vector_kph[i] < |
| 9482 | L4_MABX_P.Constant_Value_n); |
| 9483 | } |
| 9484 | |
| 9485 | /* End of RelationalOperator: '<S367>/Compare' */ |
| 9486 | |
| 9487 | /* Logic: '<S362>/Logical Operator' */ |
| 9488 | zcEvent = L4_MABX_B.Compare_nk[0]; |
| 9489 | for (i = 0; i < 32; i++) { |
| 9490 | zcEvent = (zcEvent || L4_MABX_B.Compare_nk[i + 1]); |
| 9491 | } |
| 9492 | |
| 9493 | L4_MABX_B.f_vspd_output_less_than_zero = zcEvent; |
| 9494 | |
| 9495 | /* End of Logic: '<S362>/Logical Operator' */ |
| 9496 | |
| 9497 | /* MinMax: '<S362>/MinMax3' */ |
| 9498 | PositionFinalLimited = L4_MABX_B.Vehicle_speed_vector_kph[0]; |
| 9499 | for (i = 0; i < 32; i++) { |
| 9500 | Time56 = L4_MABX_B.Vehicle_speed_vector_kph[i + 1]; |
| 9501 | if (!((PositionFinalLimited < Time56) || rtIsNaN(Time56))) { |
| 9502 | PositionFinalLimited = Time56; |
| 9503 | } |
| 9504 | } |
| 9505 | |
| 9506 | L4_MABX_B.MinMax3 = PositionFinalLimited; |
| 9507 | |
| 9508 | /* End of MinMax: '<S362>/MinMax3' */ |
| 9509 | |
| 9510 | /* UnitDelay: '<S366>/Unit_Delay' */ |
| 9511 | L4_MABX_B.Unit_Delay_f = L4_MABX_DW.Unit_Delay_DSTATE_bw; |
| 9512 | |
| 9513 | /* Outputs for Atomic SubSystem: '<S366>/If_Then_Else' */ |
| 9514 | L4_MABX_If_Then_Else_g(L4_MABX_B.LogicalOperator1_ja, L4_MABX_B.Saturation5, |
| 9515 | L4_MABX_B.Unit_Delay_f, &L4_MABX_B.If_Then_Else_og); |
| 9516 | |
| 9517 | /* End of Outputs for SubSystem: '<S366>/If_Then_Else' */ |
| 9518 | |
| 9519 | /* MinMax: '<S362>/MinMax5' */ |
| 9520 | DeltaTime = L4_MABX_B.If_Then_Else_og.Switch; |
| 9521 | PositionFinalLimited = L4_MABX_B.VSPD_TARGET_KPH_APV_gu; |
| 9522 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 9523 | PositionFinalLimited = DeltaTime; |
| 9524 | } |
| 9525 | |
| 9526 | L4_MABX_B.MinMax5 = PositionFinalLimited; |
| 9527 | |
| 9528 | /* End of MinMax: '<S362>/MinMax5' */ |
| 9529 | |
| 9530 | /* Sum: '<S362>/Subtract' */ |
| 9531 | L4_MABX_B.Subtract_al = L4_MABX_B.MinMax3 - L4_MABX_B.MinMax5; |
| 9532 | |
| 9533 | /* Abs: '<S362>/Abs' */ |
| 9534 | L4_MABX_B.Abs_m = fabs(L4_MABX_B.Subtract_al); |
| 9535 | |
| 9536 | /* RelationalOperator: '<S362>/Relational Operator' incorporates: |
| 9537 | * Constant: '<S362>/MIN_VSPD_DELTA_THRESHOLD_KPH_APV' |
| 9538 | */ |
| 9539 | L4_MABX_B.RelationalOperator_f = (L4_MABX_B.Abs_m > |
| 9540 | L4_MABX_P.MIN_VSPD_DELTA_THRESHOLD_KPH_AP); |
| 9541 | |
| 9542 | /* Logic: '<S368>/Logical Operator3' incorporates: |
| 9543 | * Constant: '<S362>/CPV' |
| 9544 | */ |
| 9545 | L4_MABX_B.LogicalOperator3_o = !L4_MABX_P.CPV_Value_a; |
| 9546 | |
| 9547 | /* UnitDelay: '<S368>/Unit_Delay' */ |
| 9548 | L4_MABX_B.Unit_Delay_ag = L4_MABX_DW.Unit_Delay_DSTATE_ko; |
| 9549 | |
| 9550 | /* Logic: '<S368>/Logical Operator' */ |
| 9551 | L4_MABX_B.LogicalOperator_ob = (L4_MABX_B.LogicalOperator3_o && |
| 9552 | L4_MABX_B.Unit_Delay_ag); |
| 9553 | |
| 9554 | /* Logic: '<S368>/Logical Operator1' */ |
| 9555 | L4_MABX_B.LogicalOperator1_ph = (L4_MABX_B.LogicalOperator1_ja || |
| 9556 | L4_MABX_B.LogicalOperator_ob); |
| 9557 | |
| 9558 | /* Logic: '<S362>/Logical Operator2' */ |
| 9559 | L4_MABX_B.f_vspd_min_delta_greater_than_t = (L4_MABX_B.RelationalOperator_f && |
| 9560 | L4_MABX_B.LogicalOperator1_ph); |
| 9561 | |
| 9562 | /* MinMax: '<S362>/MinMax4' */ |
| 9563 | PositionFinalLimited = L4_MABX_B.Vehicle_speed_vector_kph[0]; |
| 9564 | for (i = 0; i < 32; i++) { |
| 9565 | Time56 = L4_MABX_B.Vehicle_speed_vector_kph[i + 1]; |
| 9566 | if (!((PositionFinalLimited > Time56) || rtIsNaN(Time56))) { |
| 9567 | PositionFinalLimited = Time56; |
| 9568 | } |
| 9569 | } |
| 9570 | |
| 9571 | L4_MABX_B.MinMax4 = PositionFinalLimited; |
| 9572 | |
| 9573 | /* End of MinMax: '<S362>/MinMax4' */ |
| 9574 | |
| 9575 | /* MinMax: '<S362>/MinMax6' */ |
| 9576 | DeltaTime = L4_MABX_B.If_Then_Else_og.Switch; |
| 9577 | PositionFinalLimited = L4_MABX_B.VSPD_TARGET_KPH_APV_gu; |
| 9578 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 9579 | PositionFinalLimited = DeltaTime; |
| 9580 | } |
| 9581 | |
| 9582 | L4_MABX_B.MinMax6_j = PositionFinalLimited; |
| 9583 | |
| 9584 | /* End of MinMax: '<S362>/MinMax6' */ |
| 9585 | |
| 9586 | /* Sum: '<S362>/Subtract1' */ |
| 9587 | L4_MABX_B.Subtract1_c = L4_MABX_B.MinMax4 - L4_MABX_B.MinMax6_j; |
| 9588 | |
| 9589 | /* Abs: '<S362>/Abs1' */ |
| 9590 | L4_MABX_B.Abs1_h5 = fabs(L4_MABX_B.Subtract1_c); |
| 9591 | |
| 9592 | /* RelationalOperator: '<S362>/Relational Operator1' incorporates: |
| 9593 | * Constant: '<S362>/MAX_VSPD_DELTA_THRESHOLD_KPH_APV' |
| 9594 | */ |
| 9595 | L4_MABX_B.RelationalOperator1_g4j = (L4_MABX_B.Abs1_h5 > |
| 9596 | L4_MABX_P.MAX_VSPD_DELTA_THRESHOLD_KPH_AP); |
| 9597 | |
| 9598 | /* Logic: '<S362>/Logical Operator1' */ |
| 9599 | L4_MABX_B.f_vspd_max_delta_greater_than_t = (L4_MABX_B.RelationalOperator1_g4j |
| 9600 | && L4_MABX_B.LogicalOperator1_ph); |
| 9601 | |
| 9602 | /* MinMax: '<S362>/MinMax8' */ |
| 9603 | PositionFinalLimited = L4_MABX_B.AccelerationVector[0]; |
| 9604 | for (i = 0; i < 32; i++) { |
| 9605 | Time56 = L4_MABX_B.AccelerationVector[i + 1]; |
| 9606 | if (!((PositionFinalLimited > Time56) || rtIsNaN(Time56))) { |
| 9607 | PositionFinalLimited = Time56; |
| 9608 | } |
| 9609 | } |
| 9610 | |
| 9611 | L4_MABX_B.MinMax8 = PositionFinalLimited; |
| 9612 | |
| 9613 | /* End of MinMax: '<S362>/MinMax8' */ |
| 9614 | |
| 9615 | /* RelationalOperator: '<S362>/Relational Operator2' incorporates: |
| 9616 | * Constant: '<S362>/ACCEL_RATE_ABS_MAX_THRESHOLD_MS2_APV' |
| 9617 | */ |
| 9618 | L4_MABX_B.f_accel_rate_greater_than_thres = (L4_MABX_B.MinMax8 > |
| 9619 | L4_MABX_P.ACCEL_RATE_ABS_MAX_THRESHOLD_MS); |
| 9620 | |
| 9621 | /* MinMax: '<S362>/MinMax7' */ |
| 9622 | PositionFinalLimited = L4_MABX_B.AccelerationVector[0]; |
| 9623 | for (i = 0; i < 32; i++) { |
| 9624 | Time56 = L4_MABX_B.AccelerationVector[i + 1]; |
| 9625 | if (!((PositionFinalLimited < Time56) || rtIsNaN(Time56))) { |
| 9626 | PositionFinalLimited = Time56; |
| 9627 | } |
| 9628 | } |
| 9629 | |
| 9630 | L4_MABX_B.MinMax7 = PositionFinalLimited; |
| 9631 | |
| 9632 | /* End of MinMax: '<S362>/MinMax7' */ |
| 9633 | |
| 9634 | /* RelationalOperator: '<S362>/Relational Operator3' incorporates: |
| 9635 | * Constant: '<S362>/ACCEL_RATE_ABS_MIN_THRESHOLD_MS2_APV' |
| 9636 | */ |
| 9637 | L4_MABX_B.f_decel_rate_greater_than_thres = (L4_MABX_B.MinMax7 < |
| 9638 | L4_MABX_P.ACCEL_RATE_ABS_MIN_THRESHOLD_MS); |
| 9639 | |
| 9640 | /* MinMax: '<S362>/MinMax10' */ |
| 9641 | PositionFinalLimited = L4_MABX_B.JerkVector[0]; |
| 9642 | for (i = 0; i < 32; i++) { |
| 9643 | Time56 = L4_MABX_B.JerkVector[i + 1]; |
| 9644 | if (!((PositionFinalLimited > Time56) || rtIsNaN(Time56))) { |
| 9645 | PositionFinalLimited = Time56; |
| 9646 | } |
| 9647 | } |
| 9648 | |
| 9649 | L4_MABX_B.MinMax10 = PositionFinalLimited; |
| 9650 | |
| 9651 | /* End of MinMax: '<S362>/MinMax10' */ |
| 9652 | |
| 9653 | /* RelationalOperator: '<S362>/Relational Operator4' incorporates: |
| 9654 | * Constant: '<S362>/JERK_RATE_ABS_MAX_THRESHOLD_MS3_APV' |
| 9655 | */ |
| 9656 | L4_MABX_B.f_jerk_rate_greater_than_thresh = (L4_MABX_B.MinMax10 > |
| 9657 | L4_MABX_P.JERK_RATE_ABS_MAX_THRESHOLD_MS3); |
| 9658 | |
| 9659 | /* MinMax: '<S362>/MinMax9' */ |
| 9660 | PositionFinalLimited = L4_MABX_B.JerkVector[0]; |
| 9661 | for (i = 0; i < 32; i++) { |
| 9662 | Time56 = L4_MABX_B.JerkVector[i + 1]; |
| 9663 | if (!((PositionFinalLimited < Time56) || rtIsNaN(Time56))) { |
| 9664 | PositionFinalLimited = Time56; |
| 9665 | } |
| 9666 | } |
| 9667 | |
| 9668 | L4_MABX_B.MinMax9 = PositionFinalLimited; |
| 9669 | |
| 9670 | /* End of MinMax: '<S362>/MinMax9' */ |
| 9671 | |
| 9672 | /* RelationalOperator: '<S362>/Relational Operator5' incorporates: |
| 9673 | * Constant: '<S362>/JERK_RATE_ABS_MIN_THRESHOLD_MS3_APV' |
| 9674 | */ |
| 9675 | L4_MABX_B.f_jerk_rate_greater_than_thre_n = (L4_MABX_B.MinMax9 < |
| 9676 | L4_MABX_P.JERK_RATE_ABS_MIN_THRESHOLD_MS3); |
| 9677 | |
| 9678 | /* Sum: '<S362>/Subtract2' */ |
| 9679 | L4_MABX_B.Subtract2 = L4_MABX_B.Distance_to_achieve_speed_targe - |
| 9680 | L4_MABX_B.PositionVector[32]; |
| 9681 | |
| 9682 | /* Abs: '<S362>/Abs2' */ |
| 9683 | L4_MABX_B.Abs2 = fabs(L4_MABX_B.Subtract2); |
| 9684 | |
| 9685 | /* RelationalOperator: '<S362>/Relational Operator6' incorporates: |
| 9686 | * Constant: '<S362>/MAX_DISTANCE_DELTA_THRESHOLD_M_APV' |
| 9687 | */ |
| 9688 | L4_MABX_B.RelationalOperator6_i = (L4_MABX_B.Abs2 > |
| 9689 | L4_MABX_P.MAX_DISTANCE_DELTA_THRESHOLD_M_); |
| 9690 | |
| 9691 | /* Logic: '<S362>/Logical Operator3' */ |
| 9692 | L4_MABX_B.f_distance_max_delta_greater_th = (L4_MABX_B.RelationalOperator6_i && |
| 9693 | L4_MABX_B.LogicalOperator1_ph); |
| 9694 | |
| 9695 | /* Logic: '<S362>/Logical Operator4' */ |
| 9696 | L4_MABX_B.F_Inhibit_sigmoid_vector_shapin = |
| 9697 | (L4_MABX_B.f_vspd_output_less_than_zero || |
| 9698 | L4_MABX_B.f_vspd_min_delta_greater_than_t || |
| 9699 | L4_MABX_B.f_vspd_max_delta_greater_than_t || |
| 9700 | L4_MABX_B.f_accel_rate_greater_than_thres || |
| 9701 | L4_MABX_B.f_decel_rate_greater_than_thres || |
| 9702 | L4_MABX_B.f_jerk_rate_greater_than_thresh || |
| 9703 | L4_MABX_B.f_jerk_rate_greater_than_thre_n || |
| 9704 | L4_MABX_B.f_distance_max_delta_greater_th); |
| 9705 | |
| 9706 | /* Logic: '<S81>/Logical Operator' */ |
| 9707 | L4_MABX_B.LogicalOperator_nd = !L4_MABX_B.F_Inhibit_sigmoid_vector_shapin; |
| 9708 | |
| 9709 | /* Logic: '<S81>/Logical Operator2' */ |
| 9710 | L4_MABX_B.LogicalOperator2_ft = (L4_MABX_B.Compare_jr && |
| 9711 | L4_MABX_B.LogicalOperator_nd); |
| 9712 | |
| 9713 | /* RelationalOperator: '<S363>/Relational Operator3' incorporates: |
| 9714 | * Constant: '<S363>/CPV1' |
| 9715 | */ |
| 9716 | L4_MABX_B.RelationalOperator3_k = (L4_MABX_B.Saturation5 < |
| 9717 | L4_MABX_P.CPV1_Value_i); |
| 9718 | |
| 9719 | /* RelationalOperator: '<S363>/Relational Operator1' incorporates: |
| 9720 | * Constant: '<S350>/MIN_VSPD_SIGMOID_INITIAL_KPH_APV' |
| 9721 | */ |
| 9722 | L4_MABX_B.RelationalOperator1_h = (L4_MABX_B.If_Then_Else_og.Switch < |
| 9723 | L4_MABX_P.MIN_VSPD_SIGMOID_INITIAL_KPH_AP); |
| 9724 | |
| 9725 | /* Logic: '<S363>/Logical Operator' */ |
| 9726 | L4_MABX_B.LogicalOperator_da = (L4_MABX_B.RelationalOperator3_k || |
| 9727 | L4_MABX_B.RelationalOperator1_h); |
| 9728 | |
| 9729 | /* RelationalOperator: '<S363>/Relational Operator2' incorporates: |
| 9730 | * Constant: '<S350>/MIN_VSPD_SIGMOID_FINAL_KPH_APV' |
| 9731 | */ |
| 9732 | L4_MABX_B.RelationalOperator2_g = (L4_MABX_B.VSPD_TARGET_KPH_APV_gu < |
| 9733 | L4_MABX_P.MIN_VSPD_SIGMOID_FINAL_KPH_APV_); |
| 9734 | |
| 9735 | /* Logic: '<S363>/Logical Operator2' */ |
| 9736 | L4_MABX_B.F_set_max_distance_accumulated = (L4_MABX_B.LogicalOperator_da && |
| 9737 | L4_MABX_B.RelationalOperator2_g); |
| 9738 | |
| 9739 | /* UnitDelay: '<S377>/FixPt Unit Delay2' */ |
| 9740 | L4_MABX_B.FixPtUnitDelay2_o = L4_MABX_DW.FixPtUnitDelay2_DSTATE_f; |
| 9741 | |
| 9742 | /* Logic: '<S377>/FixPt Logical Operator' */ |
| 9743 | L4_MABX_B.FixPtLogicalOperator = (uint8_T)(L4_MABX_B.LogicalOperator1_ja || |
| 9744 | (L4_MABX_B.FixPtUnitDelay2_o != 0)); |
| 9745 | |
| 9746 | /* UnitDelay: '<S377>/FixPt Unit Delay1' */ |
| 9747 | L4_MABX_B.Xold_pg = L4_MABX_DW.FixPtUnitDelay1_DSTATE_l; |
| 9748 | |
| 9749 | /* Switch: '<S377>/Init' incorporates: |
| 9750 | * Constant: '<S372>/CPV' |
| 9751 | */ |
| 9752 | if (L4_MABX_B.FixPtLogicalOperator != 0) { |
| 9753 | L4_MABX_B.Init_h = L4_MABX_P.CPV_Value_h; |
| 9754 | } else { |
| 9755 | L4_MABX_B.Init_h = L4_MABX_B.Xold_pg; |
| 9756 | } |
| 9757 | |
| 9758 | /* End of Switch: '<S377>/Init' */ |
| 9759 | |
| 9760 | /* Gain: '<S363>/Gain1' */ |
| 9761 | L4_MABX_B.Gain1_c = L4_MABX_P.Gain1_Gain_k * L4_MABX_B.Saturation5; |
| 9762 | |
| 9763 | /* DigitalClock: '<S375>/Digital Clock' */ |
| 9764 | L4_MABX_B.DigitalClock_f = L4_MABX_M->Timing.t[0]; |
| 9765 | |
| 9766 | /* UnitDelay: '<S375>/Unit_Delay' */ |
| 9767 | L4_MABX_B.Unit_Delay_e = L4_MABX_DW.Unit_Delay_DSTATE_p; |
| 9768 | |
| 9769 | /* Sum: '<S375>/Subtract' */ |
| 9770 | L4_MABX_B.Subtract_b = L4_MABX_B.DigitalClock_f - L4_MABX_B.Unit_Delay_e; |
| 9771 | |
| 9772 | /* Product: '<S372>/Product1' incorporates: |
| 9773 | * Constant: '<S371>/CPV1' |
| 9774 | */ |
| 9775 | L4_MABX_B.Product1_a = L4_MABX_P.CPV1_Value_e * L4_MABX_B.Gain1_c * |
| 9776 | L4_MABX_B.Subtract_b; |
| 9777 | |
| 9778 | /* Sum: '<S372>/Add' */ |
| 9779 | L4_MABX_B.Add_h = L4_MABX_B.Init_h + L4_MABX_B.Product1_a; |
| 9780 | |
| 9781 | /* MinMax: '<S372>/MinMax' */ |
| 9782 | DeltaTime = L4_MABX_B.Distance_to_achieve_speed_targe; |
| 9783 | PositionFinalLimited = L4_MABX_B.Add_h; |
| 9784 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 9785 | PositionFinalLimited = DeltaTime; |
| 9786 | } |
| 9787 | |
| 9788 | L4_MABX_B.MinMax_a = PositionFinalLimited; |
| 9789 | |
| 9790 | /* End of MinMax: '<S372>/MinMax' */ |
| 9791 | |
| 9792 | /* Outputs for Atomic SubSystem: '<S372>/If_Then_Else' */ |
| 9793 | L4_MABX_If_Then_Else_g(L4_MABX_B.F_set_max_distance_accumulated, |
| 9794 | L4_MABX_B.Distance_to_achieve_speed_targe, L4_MABX_B.MinMax_a, |
| 9795 | &L4_MABX_B.If_Then_Else_gf); |
| 9796 | |
| 9797 | /* End of Outputs for SubSystem: '<S372>/If_Then_Else' */ |
| 9798 | |
| 9799 | /* RelationalOperator: '<S363>/Relational Operator' */ |
| 9800 | L4_MABX_B.RelationalOperator_lj = (L4_MABX_B.If_Then_Else_gf.Switch == |
| 9801 | L4_MABX_B.Distance_to_achieve_speed_targe); |
| 9802 | |
| 9803 | /* S-Function (sfix_look1_dyn): '<S363>/Lookup Table Dynamic' */ |
| 9804 | /* Dynamic Look-Up Table Block: '<S363>/Lookup Table Dynamic' |
| 9805 | * Input0 Data Type: Floating Point real_T |
| 9806 | * Input1 Data Type: Floating Point real_T |
| 9807 | * Input2 Data Type: Floating Point real_T |
| 9808 | * Output0 Data Type: Floating Point real_T |
| 9809 | * Lookup Method: Linear_Endpoint |
| 9810 | * |
| 9811 | */ |
| 9812 | LookUp_real_T_real_T( &(L4_MABX_B.LookupTableDynamic), |
| 9813 | &L4_MABX_B.Vehicle_speed_vector_kph[0], |
| 9814 | L4_MABX_B.If_Then_Else_gf.Switch, |
| 9815 | &L4_MABX_B.PositionVector[0], 32U); |
| 9816 | |
| 9817 | /* Outputs for Atomic SubSystem: '<S363>/If_Then_Else' */ |
| 9818 | L4_MABX_If_Then_Else_g(L4_MABX_B.RelationalOperator_lj, |
| 9819 | L4_MABX_B.VSPD_TARGET_KPH_APV_gu, L4_MABX_B.LookupTableDynamic, |
| 9820 | &L4_MABX_B.If_Then_Else_jh); |
| 9821 | |
| 9822 | /* End of Outputs for SubSystem: '<S363>/If_Then_Else' */ |
| 9823 | |
| 9824 | /* UnitDelay: '<S355>/Delay Input1' */ |
| 9825 | L4_MABX_B.Uk1_k[0] = L4_MABX_DW.DelayInput1_DSTATE_f[0]; |
| 9826 | L4_MABX_B.Uk1_k[1] = L4_MABX_DW.DelayInput1_DSTATE_f[1]; |
| 9827 | |
| 9828 | /* RelationalOperator: '<S355>/FixPt Relational Operator' */ |
| 9829 | L4_MABX_B.FixPtRelationalOperator_p[0] = |
| 9830 | (L4_MABX_B.Distance_to_achieve_speed_targe != L4_MABX_B.Uk1_k[0]); |
| 9831 | L4_MABX_B.FixPtRelationalOperator_p[1] = (L4_MABX_B.Vehicle_speed_target_o != |
| 9832 | L4_MABX_B.Uk1_k[1]); |
| 9833 | |
| 9834 | /* Logic: '<S349>/Logical Operator' */ |
| 9835 | L4_MABX_B.LogicalOperator_gb = (L4_MABX_B.FixPtRelationalOperator_p[0] || |
| 9836 | L4_MABX_B.FixPtRelationalOperator_p[1]); |
| 9837 | |
| 9838 | /* UnitDelay: '<S357>/Unit_Delay' */ |
| 9839 | L4_MABX_B.Unit_Delay_l = L4_MABX_DW.Unit_Delay_DSTATE_l; |
| 9840 | |
| 9841 | /* Logic: '<S357>/Logical Operator1' */ |
| 9842 | L4_MABX_B.LogicalOperator1_lp = (L4_MABX_B.LogicalOperator_gb || |
| 9843 | L4_MABX_B.Unit_Delay_l); |
| 9844 | |
| 9845 | /* UnitDelay: '<S361>/FixPt Unit Delay2' */ |
| 9846 | L4_MABX_B.FixPtUnitDelay2_nn = L4_MABX_DW.FixPtUnitDelay2_DSTATE_c; |
| 9847 | |
| 9848 | /* UnitDelay: '<S361>/FixPt Unit Delay1' */ |
| 9849 | L4_MABX_B.Xold_o = L4_MABX_DW.FixPtUnitDelay1_DSTATE_ej; |
| 9850 | |
| 9851 | /* Switch: '<S361>/Init' */ |
| 9852 | if (L4_MABX_B.FixPtUnitDelay2_nn != 0) { |
| 9853 | L4_MABX_B.Init_pn = L4_MABX_B.Vehicle_speed_target_o; |
| 9854 | } else { |
| 9855 | L4_MABX_B.Init_pn = L4_MABX_B.Xold_o; |
| 9856 | } |
| 9857 | |
| 9858 | /* End of Switch: '<S361>/Init' */ |
| 9859 | |
| 9860 | /* UnitDelay: '<S356>/Unit_Delay' */ |
| 9861 | L4_MABX_B.Vehicle_speed_target_c = L4_MABX_DW.Unit_Delay_1_DSTATE_j; |
| 9862 | L4_MABX_B.Vehicle_speed = L4_MABX_DW.Unit_Delay_2_DSTATE_e; |
| 9863 | L4_MABX_B.Distance_m = L4_MABX_DW.Unit_Delay_3_DSTATE_j; |
| 9864 | |
| 9865 | /* Outputs for Atomic SubSystem: '<S356>/If_Then_Else' */ |
| 9866 | L4_MABX_If_Then_Else_m(L4_MABX_B.LogicalOperator_gb, |
| 9867 | L4_MABX_B.Vehicle_speed_target_o, L4_MABX_B.SFunction1_o1_gd, |
| 9868 | L4_MABX_B.Distance_to_achieve_speed_targe, L4_MABX_B.Vehicle_speed_target_c, |
| 9869 | L4_MABX_B.Vehicle_speed, L4_MABX_B.Distance_m, &L4_MABX_B.If_Then_Else_mm); |
| 9870 | |
| 9871 | /* End of Outputs for SubSystem: '<S356>/If_Then_Else' */ |
| 9872 | |
| 9873 | /* Sum: '<S356>/Subtract' */ |
| 9874 | L4_MABX_B.err = L4_MABX_B.If_Then_Else_mm.Vehicle_speed - |
| 9875 | L4_MABX_B.If_Then_Else_mm.Vehicle_speed_target; |
| 9876 | |
| 9877 | /* Abs: '<S356>/Abs2' */ |
| 9878 | L4_MABX_B.err_abs = fabs(L4_MABX_B.err); |
| 9879 | |
| 9880 | /* Gain: '<S356>/Gain2' */ |
| 9881 | L4_MABX_B.Gain2_k = L4_MABX_P.Gain2_Gain_l * |
| 9882 | L4_MABX_B.If_Then_Else_mm.Vehicle_speed; |
| 9883 | |
| 9884 | /* Saturate: '<S356>/Saturation4' */ |
| 9885 | DeltaTime = L4_MABX_B.Gain2_k; |
| 9886 | Time56 = L4_MABX_P.Saturation4_LowerSat_e; |
| 9887 | AccelerationAverage = L4_MABX_P.Saturation4_UpperSat_a; |
| 9888 | if (DeltaTime > AccelerationAverage) { |
| 9889 | L4_MABX_B.Saturation4 = AccelerationAverage; |
| 9890 | } else if (DeltaTime < Time56) { |
| 9891 | L4_MABX_B.Saturation4 = Time56; |
| 9892 | } else { |
| 9893 | L4_MABX_B.Saturation4 = DeltaTime; |
| 9894 | } |
| 9895 | |
| 9896 | /* End of Saturate: '<S356>/Saturation4' */ |
| 9897 | |
| 9898 | /* Product: '<S356>/Divide2' */ |
| 9899 | L4_MABX_B.time_to_target_vspd_secs = L4_MABX_B.If_Then_Else_mm.Distance_m / |
| 9900 | L4_MABX_B.Saturation4; |
| 9901 | |
| 9902 | /* DigitalClock: '<S354>/Digital Clock' */ |
| 9903 | L4_MABX_B.DigitalClock_p = L4_MABX_M->Timing.t[0]; |
| 9904 | |
| 9905 | /* UnitDelay: '<S354>/Unit_Delay' */ |
| 9906 | L4_MABX_B.Unit_Delay_b = L4_MABX_DW.Unit_Delay_DSTATE_f; |
| 9907 | |
| 9908 | /* Sum: '<S354>/Subtract' */ |
| 9909 | L4_MABX_B.Subtract_g = L4_MABX_B.DigitalClock_p - L4_MABX_B.Unit_Delay_b; |
| 9910 | |
| 9911 | /* MinMax: '<S356>/MinMax3' */ |
| 9912 | DeltaTime = L4_MABX_B.time_to_target_vspd_secs; |
| 9913 | PositionFinalLimited = L4_MABX_B.Subtract_g; |
| 9914 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 9915 | PositionFinalLimited = DeltaTime; |
| 9916 | } |
| 9917 | |
| 9918 | L4_MABX_B.MinMax3_n = PositionFinalLimited; |
| 9919 | |
| 9920 | /* End of MinMax: '<S356>/MinMax3' */ |
| 9921 | |
| 9922 | /* Saturate: '<S356>/Saturation1' */ |
| 9923 | DeltaTime = L4_MABX_B.MinMax3_n; |
| 9924 | Time56 = L4_MABX_P.Saturation1_LowerSat_o; |
| 9925 | AccelerationAverage = L4_MABX_P.Saturation1_UpperSat_j; |
| 9926 | if (DeltaTime > AccelerationAverage) { |
| 9927 | L4_MABX_B.Saturation1_e = AccelerationAverage; |
| 9928 | } else if (DeltaTime < Time56) { |
| 9929 | L4_MABX_B.Saturation1_e = Time56; |
| 9930 | } else { |
| 9931 | L4_MABX_B.Saturation1_e = DeltaTime; |
| 9932 | } |
| 9933 | |
| 9934 | /* End of Saturate: '<S356>/Saturation1' */ |
| 9935 | |
| 9936 | /* Product: '<S356>/Divide' */ |
| 9937 | L4_MABX_B.Divide_e = L4_MABX_B.err_abs / L4_MABX_B.Saturation1_e; |
| 9938 | |
| 9939 | /* Abs: '<S357>/Abs' */ |
| 9940 | L4_MABX_B.Abs_ma = fabs(L4_MABX_B.Divide_e); |
| 9941 | |
| 9942 | /* Product: '<S357>/Product1' */ |
| 9943 | L4_MABX_B.Product1_iv = L4_MABX_B.Abs_ma * L4_MABX_B.Subtract_g; |
| 9944 | |
| 9945 | /* Sum: '<S357>/Add1' */ |
| 9946 | L4_MABX_B.Add1_bf = L4_MABX_B.Init_pn + L4_MABX_B.Product1_iv; |
| 9947 | |
| 9948 | /* MinMax: '<S357>/MinMax2' */ |
| 9949 | DeltaTime = L4_MABX_B.Vehicle_speed_target_o; |
| 9950 | PositionFinalLimited = L4_MABX_B.Add1_bf; |
| 9951 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 9952 | PositionFinalLimited = DeltaTime; |
| 9953 | } |
| 9954 | |
| 9955 | L4_MABX_B.MinMax2_c = PositionFinalLimited; |
| 9956 | |
| 9957 | /* End of MinMax: '<S357>/MinMax2' */ |
| 9958 | |
| 9959 | /* Abs: '<S357>/Abs1' */ |
| 9960 | L4_MABX_B.Abs1_f = fabs(L4_MABX_B.Divide_e); |
| 9961 | |
| 9962 | /* Product: '<S357>/Product2' */ |
| 9963 | L4_MABX_B.Product2_m = L4_MABX_B.Subtract_g * L4_MABX_B.Abs1_f; |
| 9964 | |
| 9965 | /* Sum: '<S357>/Subtract1' */ |
| 9966 | L4_MABX_B.Subtract1_h2 = L4_MABX_B.Init_pn - L4_MABX_B.Product2_m; |
| 9967 | |
| 9968 | /* MinMax: '<S357>/MinMax1' */ |
| 9969 | DeltaTime = L4_MABX_B.MinMax2_c; |
| 9970 | PositionFinalLimited = L4_MABX_B.Subtract1_h2; |
| 9971 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 9972 | PositionFinalLimited = DeltaTime; |
| 9973 | } |
| 9974 | |
| 9975 | L4_MABX_B.MinMax1_p = PositionFinalLimited; |
| 9976 | |
| 9977 | /* End of MinMax: '<S357>/MinMax1' */ |
| 9978 | |
| 9979 | /* Outputs for Atomic SubSystem: '<S357>/If_Then_Else' */ |
| 9980 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_lp, L4_MABX_B.SFunction1_o1_gd, |
| 9981 | L4_MABX_B.MinMax1_p, &L4_MABX_B.If_Then_Else_pz); |
| 9982 | |
| 9983 | /* End of Outputs for SubSystem: '<S357>/If_Then_Else' */ |
| 9984 | |
| 9985 | /* Outputs for Atomic SubSystem: '<S81>/If_Then_Else' */ |
| 9986 | L4_MABX_If_Then_Else_g(L4_MABX_B.LogicalOperator2_ft, |
| 9987 | L4_MABX_B.If_Then_Else_jh.Switch, L4_MABX_B.If_Then_Else_pz.Switch, |
| 9988 | &L4_MABX_B.If_Then_Else_ji); |
| 9989 | |
| 9990 | /* End of Outputs for SubSystem: '<S81>/If_Then_Else' */ |
| 9991 | |
| 9992 | /* MinMax: '<S81>/MinMax' */ |
| 9993 | DeltaTime = L4_MABX_B.If_Then_Else_m4.Switch; |
| 9994 | PositionFinalLimited = L4_MABX_B.If_Then_Else_bf.Switch; |
| 9995 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 9996 | PositionFinalLimited = DeltaTime; |
| 9997 | } |
| 9998 | |
| 9999 | Time56 = L4_MABX_B.Vehicle_speed_abs_max; |
| 10000 | if (!((PositionFinalLimited < Time56) || rtIsNaN(Time56))) { |
| 10001 | PositionFinalLimited = Time56; |
| 10002 | } |
| 10003 | |
| 10004 | Time56 = L4_MABX_B.If_Then_Else_ji.Switch; |
| 10005 | if (!((PositionFinalLimited < Time56) || rtIsNaN(Time56))) { |
| 10006 | PositionFinalLimited = Time56; |
| 10007 | } |
| 10008 | |
| 10009 | L4_MABX_B.MinMax_o = PositionFinalLimited; |
| 10010 | |
| 10011 | /* End of MinMax: '<S81>/MinMax' */ |
| 10012 | |
| 10013 | /* Saturate: '<S81>/Saturation8' */ |
| 10014 | DeltaTime = L4_MABX_B.MinMax_o; |
| 10015 | Time56 = L4_MABX_P.Saturation8_LowerSat; |
| 10016 | AccelerationAverage = L4_MABX_P.Saturation8_UpperSat; |
| 10017 | if (DeltaTime > AccelerationAverage) { |
| 10018 | L4_MABX_B.Vehicle_speed_target_n = AccelerationAverage; |
| 10019 | } else if (DeltaTime < Time56) { |
| 10020 | L4_MABX_B.Vehicle_speed_target_n = Time56; |
| 10021 | } else { |
| 10022 | L4_MABX_B.Vehicle_speed_target_n = DeltaTime; |
| 10023 | } |
| 10024 | |
| 10025 | /* End of Saturate: '<S81>/Saturation8' */ |
| 10026 | |
| 10027 | /* Lookup_n-D: '<S200>/2D_Lookup_Table' */ |
| 10028 | L4_MABX_B.uD_Lookup_Table_l = look2_binlcapw(0.0, |
| 10029 | L4_MABX_B.SPN1760_GrossCombinationVehicle, BRK_GOV_FF_DECEL_RATE_STEP_MPV, |
| 10030 | BRK_GOV_FF_MASS_STEP_MPV, BRK_GOV_FF_PRESS_KPA_DATA_MPV, |
| 10031 | L4_MABX_P.uD_Lookup_Table_maxIndex_e, 16U); |
| 10032 | |
| 10033 | /* Product: '<S106>/Divide' */ |
| 10034 | L4_MABX_B.Divide_f = L4_MABX_B.uD_Lookup_Table_l / |
| 10035 | L4_MABX_B.Primary_brake_circuit_pressur_n; |
| 10036 | |
| 10037 | /* Gain: '<S106>/Gain1' */ |
| 10038 | L4_MABX_B.Gain1_l = L4_MABX_P.Gain1_Gain_o * L4_MABX_B.Divide_f; |
| 10039 | |
| 10040 | /* Saturate: '<S106>/Saturation1' */ |
| 10041 | DeltaTime = L4_MABX_B.Gain1_l; |
| 10042 | Time56 = L4_MABX_P.Saturation1_LowerSat_n; |
| 10043 | AccelerationAverage = L4_MABX_P.Saturation1_UpperSat_l; |
| 10044 | if (DeltaTime > AccelerationAverage) { |
| 10045 | L4_MABX_B.Brake_appl_percent_to_achieve_d = AccelerationAverage; |
| 10046 | } else if (DeltaTime < Time56) { |
| 10047 | L4_MABX_B.Brake_appl_percent_to_achieve_d = Time56; |
| 10048 | } else { |
| 10049 | L4_MABX_B.Brake_appl_percent_to_achieve_d = DeltaTime; |
| 10050 | } |
| 10051 | |
| 10052 | /* End of Saturate: '<S106>/Saturation1' */ |
| 10053 | |
| 10054 | /* Saturate: '<S81>/Saturation2' incorporates: |
| 10055 | * Constant: '<S81>/ACCEL_LIM_MS2_APV' |
| 10056 | */ |
| 10057 | DeltaTime = L4_MABX_P.ACCEL_LIM_MS2_APV_Value; |
| 10058 | Time56 = L4_MABX_P.Saturation2_LowerSat_l; |
| 10059 | AccelerationAverage = L4_MABX_P.Saturation2_UpperSat_a; |
| 10060 | if (DeltaTime > AccelerationAverage) { |
| 10061 | L4_MABX_B.ACCEL_LIM_MS2_APV_b = AccelerationAverage; |
| 10062 | } else if (DeltaTime < Time56) { |
| 10063 | L4_MABX_B.ACCEL_LIM_MS2_APV_b = Time56; |
| 10064 | } else { |
| 10065 | L4_MABX_B.ACCEL_LIM_MS2_APV_b = DeltaTime; |
| 10066 | } |
| 10067 | |
| 10068 | /* End of Saturate: '<S81>/Saturation2' */ |
| 10069 | |
| 10070 | /* Lookup_n-D: '<S201>/2D_Lookup_Table' */ |
| 10071 | L4_MABX_B.uD_Lookup_Table_i = look2_binlcapw(L4_MABX_B.ACCEL_LIM_MS2_APV_b, |
| 10072 | L4_MABX_B.SPN1760_GrossCombinationVehicle, BRK_GOV_FF_DECEL_RATE_STEP_MPV, |
| 10073 | BRK_GOV_FF_MASS_STEP_MPV, BRK_GOV_FF_PRESS_KPA_DATA_MPV, |
| 10074 | L4_MABX_P.uD_Lookup_Table_maxIndex_n, 16U); |
| 10075 | |
| 10076 | /* Product: '<S106>/Divide1' */ |
| 10077 | L4_MABX_B.Divide1_f = L4_MABX_B.uD_Lookup_Table_i / |
| 10078 | L4_MABX_B.Primary_brake_circuit_pressur_n; |
| 10079 | |
| 10080 | /* Gain: '<S106>/Gain2' */ |
| 10081 | L4_MABX_B.Gain2_e = L4_MABX_P.Gain2_Gain_b * L4_MABX_B.Divide1_f; |
| 10082 | |
| 10083 | /* Saturate: '<S106>/Saturation2' */ |
| 10084 | DeltaTime = L4_MABX_B.Gain2_e; |
| 10085 | Time56 = L4_MABX_P.Saturation2_LowerSat_o; |
| 10086 | AccelerationAverage = L4_MABX_P.Saturation2_UpperSat_b; |
| 10087 | if (DeltaTime > AccelerationAverage) { |
| 10088 | L4_MABX_B.Brake_appl_percent_for_maximum_ = AccelerationAverage; |
| 10089 | } else if (DeltaTime < Time56) { |
| 10090 | L4_MABX_B.Brake_appl_percent_for_maximum_ = Time56; |
| 10091 | } else { |
| 10092 | L4_MABX_B.Brake_appl_percent_for_maximum_ = DeltaTime; |
| 10093 | } |
| 10094 | |
| 10095 | /* End of Saturate: '<S106>/Saturation2' */ |
| 10096 | |
| 10097 | /* DataTypeConversion: '<S77>/Data Type Conversion2' */ |
| 10098 | L4_MABX_B.DataTypeConversion2_l = L4_MABX_B.SPN1760_GrossCombinationVehicle; |
| 10099 | |
| 10100 | /* Outputs for Enabled SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' incorporates: |
| 10101 | * EnablePort: '<S103>/Enable' |
| 10102 | */ |
| 10103 | if (L4_MABX_B.F_Brake_control_active) { |
| 10104 | if (!L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba) { |
| 10105 | /* InitializeConditions for UnitDelay: '<S146>/Unit_Delay' */ |
| 10106 | L4_MABX_DW.Unit_Delay_DSTATE_eu = L4_MABX_P.Unit_Delay_InitialCondition_f; |
| 10107 | |
| 10108 | /* InitializeConditions for UnitDelay: '<S153>/Unit_Delay' */ |
| 10109 | L4_MABX_DW.Unit_Delay_DSTATE_n = L4_MABX_P.Unit_Delay_InitialCondition_jb; |
| 10110 | |
| 10111 | /* InitializeConditions for UnitDelay: '<S173>/Unit_Delay1' */ |
| 10112 | L4_MABX_DW.Unit_Delay1_DSTATE_f = L4_MABX_P.Unit_Delay1_InitialCondition_p; |
| 10113 | |
| 10114 | /* InitializeConditions for UnitDelay: '<S174>/Unit_Delay' */ |
| 10115 | L4_MABX_DW.Unit_Delay_DSTATE_g4 = L4_MABX_P.Unit_Delay_InitialCondition_lq; |
| 10116 | |
| 10117 | /* InitializeConditions for UnitDelay: '<S178>/FixPt Unit Delay2' */ |
| 10118 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_o = |
| 10119 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_p; |
| 10120 | |
| 10121 | /* InitializeConditions for UnitDelay: '<S178>/FixPt Unit Delay1' */ |
| 10122 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g2 = |
| 10123 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_b; |
| 10124 | |
| 10125 | /* InitializeConditions for UnitDelay: '<S173>/Unit_Delay2' */ |
| 10126 | L4_MABX_DW.Unit_Delay2_DSTATE_c = L4_MABX_P.Unit_Delay2_InitialCondition_b; |
| 10127 | |
| 10128 | /* InitializeConditions for UnitDelay: '<S145>/Unit_Delay' */ |
| 10129 | L4_MABX_DW.Unit_Delay_DSTATE_h = L4_MABX_P.Unit_Delay_InitialCondition_h; |
| 10130 | L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba = true; |
| 10131 | } |
| 10132 | |
| 10133 | /* Lookup_n-D: '<S147>/1D_Lookup_Table' */ |
| 10134 | L4_MABX_B.uD_Lookup_Table_f = look1_binlcapw(L4_MABX_B.DataTypeConversion2_l, |
| 10135 | BRK_DEM_MASS_STEP_MPV, BRK_DEM_KP_DATA_MPV, 7U); |
| 10136 | |
| 10137 | /* Lookup_n-D: '<S148>/1D_Lookup_Table' */ |
| 10138 | L4_MABX_B.uD_Lookup_Table_p = look1_binlcapw(L4_MABX_B.DataTypeConversion2_l, |
| 10139 | BRK_DEM_MASS_STEP_MPV, BRK_DEM_KI_DATA_MPV, 7U); |
| 10140 | |
| 10141 | /* Lookup_n-D: '<S149>/1D_Lookup_Table' */ |
| 10142 | L4_MABX_B.uD_Lookup_Table_o5 = look1_binlcapw |
| 10143 | (L4_MABX_B.DataTypeConversion2_l, BRK_DEM_MASS_STEP_MPV, |
| 10144 | BRK_DEM_KD_DATA_MPV, 7U); |
| 10145 | |
| 10146 | /* Abs: '<S150>/Abs' */ |
| 10147 | L4_MABX_B.Abs_k1 = fabs(L4_MABX_B.uD_Lookup_Table_p); |
| 10148 | |
| 10149 | /* Abs: '<S150>/Abs1' */ |
| 10150 | L4_MABX_B.Abs1_eg = fabs(L4_MABX_B.uD_Lookup_Table_o5); |
| 10151 | |
| 10152 | /* DigitalClock: '<S146>/Digital Clock' */ |
| 10153 | L4_MABX_B.DigitalClock_n = L4_MABX_M->Timing.t[0]; |
| 10154 | |
| 10155 | /* UnitDelay: '<S146>/Unit_Delay' */ |
| 10156 | L4_MABX_B.Unit_Delay_ko = L4_MABX_DW.Unit_Delay_DSTATE_eu; |
| 10157 | |
| 10158 | /* Sum: '<S146>/Subtract' */ |
| 10159 | L4_MABX_B.Subtract_ac = L4_MABX_B.DigitalClock_n - L4_MABX_B.Unit_Delay_ko; |
| 10160 | |
| 10161 | /* UnitDelay: '<S153>/Unit_Delay' */ |
| 10162 | L4_MABX_B.Unit_Delay_m1 = L4_MABX_DW.Unit_Delay_DSTATE_n; |
| 10163 | |
| 10164 | /* Logic: '<S153>/Logical Operator1' incorporates: |
| 10165 | * Constant: '<S103>/CPV2' |
| 10166 | */ |
| 10167 | L4_MABX_B.LogicalOperator1_pf = (L4_MABX_B.Unit_Delay_m1 || |
| 10168 | L4_MABX_P.CPV2_Value_a); |
| 10169 | |
| 10170 | /* UnitDelay: '<S173>/Unit_Delay1' */ |
| 10171 | L4_MABX_B.Unit_Delay1_jk = L4_MABX_DW.Unit_Delay1_DSTATE_f; |
| 10172 | |
| 10173 | /* Logic: '<S173>/Logical Operator' */ |
| 10174 | L4_MABX_B.LogicalOperator_l = (L4_MABX_B.LogicalOperator1_pf || |
| 10175 | L4_MABX_B.Unit_Delay1_jk); |
| 10176 | |
| 10177 | /* UnitDelay: '<S174>/Unit_Delay' */ |
| 10178 | L4_MABX_B.Unit_Delay_li = L4_MABX_DW.Unit_Delay_DSTATE_g4; |
| 10179 | |
| 10180 | /* Logic: '<S174>/Logical Operator1' */ |
| 10181 | L4_MABX_B.LogicalOperator1_oy = (L4_MABX_B.LogicalOperator1_pf || |
| 10182 | L4_MABX_B.Unit_Delay_li); |
| 10183 | |
| 10184 | /* UnitDelay: '<S178>/FixPt Unit Delay2' */ |
| 10185 | L4_MABX_B.FixPtUnitDelay2_mf = L4_MABX_DW.FixPtUnitDelay2_DSTATE_o; |
| 10186 | |
| 10187 | /* UnitDelay: '<S178>/FixPt Unit Delay1' */ |
| 10188 | L4_MABX_B.Xold_c = L4_MABX_DW.FixPtUnitDelay1_DSTATE_g2; |
| 10189 | |
| 10190 | /* Switch: '<S178>/Init' */ |
| 10191 | if (L4_MABX_B.FixPtUnitDelay2_mf != 0) { |
| 10192 | L4_MABX_B.Init_cy = L4_MABX_B.Vehicle_speed_target_n; |
| 10193 | } else { |
| 10194 | L4_MABX_B.Init_cy = L4_MABX_B.Xold_c; |
| 10195 | } |
| 10196 | |
| 10197 | /* End of Switch: '<S178>/Init' */ |
| 10198 | |
| 10199 | /* Abs: '<S174>/Abs' incorporates: |
| 10200 | * Constant: '<S103>/BRK_DECEL_DEM_SLEW_INC_APV' |
| 10201 | */ |
| 10202 | L4_MABX_B.Abs_o = fabs(L4_MABX_P.BRK_DECEL_DEM_SLEW_INC_APV_Valu); |
| 10203 | |
| 10204 | /* Product: '<S174>/Product1' */ |
| 10205 | L4_MABX_B.Product1_hy = L4_MABX_B.Abs_o * L4_MABX_B.Subtract_ac; |
| 10206 | |
| 10207 | /* Sum: '<S174>/Add1' */ |
| 10208 | L4_MABX_B.Add1_o = L4_MABX_B.Init_cy + L4_MABX_B.Product1_hy; |
| 10209 | |
| 10210 | /* MinMax: '<S174>/MinMax2' */ |
| 10211 | DeltaTime = L4_MABX_B.Vehicle_speed_target_n; |
| 10212 | PositionFinalLimited = L4_MABX_B.Add1_o; |
| 10213 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 10214 | PositionFinalLimited = DeltaTime; |
| 10215 | } |
| 10216 | |
| 10217 | L4_MABX_B.MinMax2_p = PositionFinalLimited; |
| 10218 | |
| 10219 | /* End of MinMax: '<S174>/MinMax2' */ |
| 10220 | |
| 10221 | /* Abs: '<S174>/Abs1' incorporates: |
| 10222 | * Constant: '<S103>/BRK_DECEL_DEM_SLEW_DEC_APV' |
| 10223 | */ |
| 10224 | L4_MABX_B.Abs1_g = fabs(L4_MABX_P.BRK_DECEL_DEM_SLEW_DEC_APV_Valu); |
| 10225 | |
| 10226 | /* Product: '<S174>/Product2' */ |
| 10227 | L4_MABX_B.Product2_fh = L4_MABX_B.Subtract_ac * L4_MABX_B.Abs1_g; |
| 10228 | |
| 10229 | /* Sum: '<S174>/Subtract1' */ |
| 10230 | L4_MABX_B.Subtract1_fa = L4_MABX_B.Init_cy - L4_MABX_B.Product2_fh; |
| 10231 | |
| 10232 | /* MinMax: '<S174>/MinMax1' */ |
| 10233 | DeltaTime = L4_MABX_B.MinMax2_p; |
| 10234 | PositionFinalLimited = L4_MABX_B.Subtract1_fa; |
| 10235 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 10236 | PositionFinalLimited = DeltaTime; |
| 10237 | } |
| 10238 | |
| 10239 | L4_MABX_B.MinMax1_hl = PositionFinalLimited; |
| 10240 | |
| 10241 | /* End of MinMax: '<S174>/MinMax1' */ |
| 10242 | |
| 10243 | /* Outputs for Atomic SubSystem: '<S174>/If_Then_Else' */ |
| 10244 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_oy, |
| 10245 | L4_MABX_B.DataTypeConversion5_o, L4_MABX_B.MinMax1_hl, |
| 10246 | &L4_MABX_B.If_Then_Else_iy); |
| 10247 | |
| 10248 | /* End of Outputs for SubSystem: '<S174>/If_Then_Else' */ |
| 10249 | |
| 10250 | /* Sum: '<S151>/Subtract' */ |
| 10251 | L4_MABX_B.Subtract_jh = L4_MABX_B.If_Then_Else_iy.Switch - |
| 10252 | L4_MABX_B.DataTypeConversion5_o; |
| 10253 | |
| 10254 | /* MinMax: '<S173>/MinMax1' incorporates: |
| 10255 | * Constant: '<S103>/BRK_DECEL_DEM_T_FILT_CTRL_ERROR_APV' |
| 10256 | */ |
| 10257 | DeltaTime = L4_MABX_B.Subtract_ac; |
| 10258 | PositionFinalLimited = L4_MABX_P.BRK_DECEL_DEM_T_FILT_CTRL_ERROR; |
| 10259 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 10260 | PositionFinalLimited = DeltaTime; |
| 10261 | } |
| 10262 | |
| 10263 | L4_MABX_B.MinMax1_jg = PositionFinalLimited; |
| 10264 | |
| 10265 | /* End of MinMax: '<S173>/MinMax1' */ |
| 10266 | |
| 10267 | /* Saturate: '<S173>/Saturation' */ |
| 10268 | DeltaTime = L4_MABX_B.MinMax1_jg; |
| 10269 | Time56 = L4_MABX_P.Saturation_LowerSat_g; |
| 10270 | AccelerationAverage = L4_MABX_P.Saturation_UpperSat_o; |
| 10271 | if (DeltaTime > AccelerationAverage) { |
| 10272 | L4_MABX_B.Saturation_m = AccelerationAverage; |
| 10273 | } else if (DeltaTime < Time56) { |
| 10274 | L4_MABX_B.Saturation_m = Time56; |
| 10275 | } else { |
| 10276 | L4_MABX_B.Saturation_m = DeltaTime; |
| 10277 | } |
| 10278 | |
| 10279 | /* End of Saturate: '<S173>/Saturation' */ |
| 10280 | |
| 10281 | /* Product: '<S173>/Divide' */ |
| 10282 | L4_MABX_B.Divide_af = L4_MABX_B.Subtract_ac / L4_MABX_B.Saturation_m; |
| 10283 | |
| 10284 | /* Product: '<S173>/Product2' */ |
| 10285 | L4_MABX_B.Product2_ce = L4_MABX_B.Subtract_jh * L4_MABX_B.Divide_af; |
| 10286 | |
| 10287 | /* Sum: '<S173>/Subtract1' incorporates: |
| 10288 | * Constant: '<S173>/Constant1' |
| 10289 | */ |
| 10290 | L4_MABX_B.Subtract1_cr = L4_MABX_P.Constant1_Value_o - L4_MABX_B.Divide_af; |
| 10291 | |
| 10292 | /* UnitDelay: '<S173>/Unit_Delay2' */ |
| 10293 | L4_MABX_B.Unit_Delay2_a = L4_MABX_DW.Unit_Delay2_DSTATE_c; |
| 10294 | |
| 10295 | /* Product: '<S173>/Product1' */ |
| 10296 | L4_MABX_B.Product1_ch = L4_MABX_B.Subtract1_cr * L4_MABX_B.Unit_Delay2_a; |
| 10297 | |
| 10298 | /* Sum: '<S173>/Add1' */ |
| 10299 | L4_MABX_B.Add1_hla = L4_MABX_B.Product2_ce + L4_MABX_B.Product1_ch; |
| 10300 | |
| 10301 | /* Outputs for Atomic SubSystem: '<S173>/If_Then_Else' */ |
| 10302 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_l, L4_MABX_B.Subtract_jh, |
| 10303 | L4_MABX_B.Add1_hla, &L4_MABX_B.If_Then_Else_bc); |
| 10304 | |
| 10305 | /* End of Outputs for SubSystem: '<S173>/If_Then_Else' */ |
| 10306 | |
| 10307 | /* RelationalOperator: '<S158>/Compare' incorporates: |
| 10308 | * Constant: '<S158>/Constant' |
| 10309 | */ |
| 10310 | L4_MABX_B.Compare_ni = (L4_MABX_B.Abs1_eg > |
| 10311 | L4_MABX_P.CompareToConstant1_const_m); |
| 10312 | |
| 10313 | /* Outputs for Enabled SubSystem: '<S150>/Calculate_D_term' */ |
| 10314 | |
| 10315 | /* Constant: '<S103>/BRK_DECEL_DEM_T_FILT_D_APV' */ |
| 10316 | L4_MABX_Calculate_D_term(L4_MABX_B.Compare_ni, L4_MABX_B.uD_Lookup_Table_o5, |
| 10317 | L4_MABX_B.Subtract_ac, L4_MABX_B.LogicalOperator1_pf, |
| 10318 | L4_MABX_B.If_Then_Else_bc.Switch, |
| 10319 | L4_MABX_P.BRK_DECEL_DEM_T_FILT_D_APV_Valu, &L4_MABX_B.Calculate_D_term_p, |
| 10320 | &L4_MABX_DW.Calculate_D_term_p, &L4_MABX_P.Calculate_D_term_p); |
| 10321 | |
| 10322 | /* End of Outputs for SubSystem: '<S150>/Calculate_D_term' */ |
| 10323 | |
| 10324 | /* Product: '<S156>/Product' */ |
| 10325 | L4_MABX_B.Product_f = L4_MABX_B.uD_Lookup_Table_f * |
| 10326 | L4_MABX_B.If_Then_Else_bc.Switch; |
| 10327 | |
| 10328 | /* UnitDelay: '<S145>/Unit_Delay' */ |
| 10329 | L4_MABX_B.Unit_Delay_fg = L4_MABX_DW.Unit_Delay_DSTATE_h; |
| 10330 | |
| 10331 | /* RelationalOperator: '<S157>/Compare' incorporates: |
| 10332 | * Constant: '<S157>/Constant' |
| 10333 | */ |
| 10334 | L4_MABX_B.Compare_dl = (L4_MABX_B.Abs_k1 > |
| 10335 | L4_MABX_P.CompareToConstant_const_c); |
| 10336 | |
| 10337 | /* Outputs for Enabled SubSystem: '<S150>/Calculate_I_term' */ |
| 10338 | |
| 10339 | /* Constant: '<S103>/BRK_DECEL_DEM_AW_COND_INT_APV' incorporates: |
| 10340 | * Constant: '<S103>/BRK_DECEL_DEM_AW_HYSTERESIS_APV' |
| 10341 | * Constant: '<S103>/CPV1' |
| 10342 | */ |
| 10343 | L4_MABX_Calculate_I_term(L4_MABX_B.Compare_dl, L4_MABX_B.Product_f, |
| 10344 | L4_MABX_B.uD_Lookup_Table_p, L4_MABX_B.Brake_appl_percent, |
| 10345 | L4_MABX_B.If_Then_Else_bc.Switch, L4_MABX_B.LogicalOperator1_pf, |
| 10346 | L4_MABX_B.Subtract_ac, L4_MABX_B.Brake_appl_percent_to_achieve_d, |
| 10347 | L4_MABX_P.BRK_DECEL_DEM_AW_COND_INT_APV_V, |
| 10348 | L4_MABX_P.BRK_DECEL_DEM_AW_HYSTERESIS_APV, L4_MABX_P.CPV1_Value_no, |
| 10349 | L4_MABX_B.Unit_Delay_fg, &L4_MABX_B.Calculate_I_term_e, |
| 10350 | &L4_MABX_DW.Calculate_I_term_e, &L4_MABX_P.Calculate_I_term_e); |
| 10351 | |
| 10352 | /* End of Outputs for SubSystem: '<S150>/Calculate_I_term' */ |
| 10353 | |
| 10354 | /* RelationalOperator: '<S176>/min_relop' incorporates: |
| 10355 | * Constant: '<S103>/BRK_DECEL_DEM_SLEW_INC_APV' |
| 10356 | * Constant: '<S176>/min_val' |
| 10357 | */ |
| 10358 | L4_MABX_B.min_relop_a5 = (L4_MABX_P.CheckStaticLowerBound_min_d <= |
| 10359 | L4_MABX_P.BRK_DECEL_DEM_SLEW_INC_APV_Valu); |
| 10360 | |
| 10361 | /* Assertion: '<S176>/Assertion' */ |
| 10362 | utAssert(L4_MABX_B.min_relop_a5); |
| 10363 | |
| 10364 | /* Sum: '<S152>/Add' */ |
| 10365 | L4_MABX_B.Add_mh = ((L4_MABX_B.Product_f + |
| 10366 | L4_MABX_B.Calculate_I_term_e.If_Then_Else.Switch) + |
| 10367 | L4_MABX_B.Calculate_D_term_p.Subtract) + |
| 10368 | L4_MABX_B.Brake_appl_percent_to_achieve_d; |
| 10369 | |
| 10370 | /* RelationalOperator: '<S179>/Relational Operator1' */ |
| 10371 | L4_MABX_B.RelationalOperator1_k = (L4_MABX_B.Add_mh >= |
| 10372 | L4_MABX_B.Brake_appl_percent_for_maximum_); |
| 10373 | |
| 10374 | /* RelationalOperator: '<S179>/Relational Operator' incorporates: |
| 10375 | * Constant: '<S103>/CPV' |
| 10376 | */ |
| 10377 | L4_MABX_B.RelationalOperator_m1 = (L4_MABX_B.Add_mh <= L4_MABX_P.CPV_Value_i); |
| 10378 | |
| 10379 | /* Outputs for Atomic SubSystem: '<S179>/If_Then_Else1' */ |
| 10380 | |
| 10381 | /* Constant: '<S103>/CPV' */ |
| 10382 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_m1, L4_MABX_P.CPV_Value_i, |
| 10383 | L4_MABX_B.Add_mh, &L4_MABX_B.If_Then_Else1_gx); |
| 10384 | |
| 10385 | /* End of Outputs for SubSystem: '<S179>/If_Then_Else1' */ |
| 10386 | |
| 10387 | /* Outputs for Atomic SubSystem: '<S179>/If_Then_Else' */ |
| 10388 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_k, |
| 10389 | L4_MABX_B.Brake_appl_percent_for_maximum_, |
| 10390 | L4_MABX_B.If_Then_Else1_gx.Switch, |
| 10391 | &L4_MABX_B.If_Then_Else_fo); |
| 10392 | |
| 10393 | /* End of Outputs for SubSystem: '<S179>/If_Then_Else' */ |
| 10394 | } else { |
| 10395 | if (L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba) { |
| 10396 | /* Disable for Enabled SubSystem: '<S150>/Calculate_D_term' */ |
| 10397 | if (L4_MABX_DW.Calculate_D_term_p.Calculate_D_term_MODE) { |
| 10398 | L4_Calculate_D_term_Disable(&L4_MABX_B.Calculate_D_term_p, |
| 10399 | &L4_MABX_DW.Calculate_D_term_p, &L4_MABX_P.Calculate_D_term_p); |
| 10400 | } |
| 10401 | |
| 10402 | /* End of Disable for SubSystem: '<S150>/Calculate_D_term' */ |
| 10403 | |
| 10404 | /* Disable for Enabled SubSystem: '<S150>/Calculate_I_term' */ |
| 10405 | if (L4_MABX_DW.Calculate_I_term_e.Calculate_I_term_MODE) { |
| 10406 | L4_Calculate_I_term_Disable(&L4_MABX_B.Calculate_I_term_e, |
| 10407 | &L4_MABX_DW.Calculate_I_term_e, &L4_MABX_P.Calculate_I_term_e); |
| 10408 | } |
| 10409 | |
| 10410 | /* End of Disable for SubSystem: '<S150>/Calculate_I_term' */ |
| 10411 | |
| 10412 | /* Disable for Outport: '<S103>/PID_output' */ |
| 10413 | L4_MABX_B.If_Then_Else_fo.Switch = L4_MABX_P.PID_output_Y0_p; |
| 10414 | L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba = false; |
| 10415 | } |
| 10416 | } |
| 10417 | |
| 10418 | /* End of Outputs for SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */ |
| 10419 | |
| 10420 | /* RelationalOperator: '<S104>/Relational Operator2' incorporates: |
| 10421 | * Constant: '<S104>/CPV2' |
| 10422 | */ |
| 10423 | L4_MABX_B.F_Driver_braking = (L4_MABX_B.XPRControlMode == |
| 10424 | L4_MABX_P.CPV2_Value_hm); |
| 10425 | |
| 10426 | /* Logic: '<S104>/Logical Operator2' */ |
| 10427 | L4_MABX_B.F_Operator_brake_appl = (L4_MABX_B.If_Then_Else_la.Switch && |
| 10428 | L4_MABX_B.F_Driver_braking); |
| 10429 | |
| 10430 | /* RelationalOperator: '<S104>/Relational Operator5' incorporates: |
| 10431 | * Constant: '<S104>/BENDIX_2C2_BRAKE_APPL_THRESHOLD_KPA_APV' |
| 10432 | */ |
| 10433 | L4_MABX_B.RelationalOperator5[0] = (L4_MABX_B.Bendix_2C2_Primary_brake_circui > |
| 10434 | L4_MABX_P.BENDIX_2C2_BRAKE_APPL_THRESHOLD); |
| 10435 | L4_MABX_B.RelationalOperator5[1] = (L4_MABX_B.Bendix_2C2_Secondary_brake_circ > |
| 10436 | L4_MABX_P.BENDIX_2C2_BRAKE_APPL_THRESHOLD); |
| 10437 | |
| 10438 | /* Logic: '<S104>/Logical Operator6' */ |
| 10439 | L4_MABX_B.F_Bendix_2C2_service_brake_pres = (L4_MABX_B.RelationalOperator5[0] || |
| 10440 | L4_MABX_B.RelationalOperator5[1]); |
| 10441 | |
| 10442 | /* RelationalOperator: '<S104>/Relational Operator' incorporates: |
| 10443 | * Constant: '<S104>/CPV' |
| 10444 | */ |
| 10445 | L4_MABX_B.F_Bendix_2C2_braking = (L4_MABX_B.XPRControlMode == |
| 10446 | L4_MABX_P.CPV_Value_e); |
| 10447 | |
| 10448 | /* Logic: '<S104>/Logical Operator7' */ |
| 10449 | L4_MABX_B.F_ADAS_brake_appl = (L4_MABX_B.If_Then_Else_la.Switch && |
| 10450 | L4_MABX_B.F_Bendix_2C2_braking && L4_MABX_B.F_Bendix_2C2_service_brake_pres); |
| 10451 | |
| 10452 | /* RelationalOperator: '<S104>/Relational Operator1' incorporates: |
| 10453 | * Constant: '<S104>/CPV1' |
| 10454 | */ |
| 10455 | L4_MABX_B.F_ADAS_brake_error = (L4_MABX_B.XPRErrorState != |
| 10456 | L4_MABX_P.CPV1_Value_i5); |
| 10457 | |
| 10458 | /* Lookup_n-D: '<S199>/2D_Lookup_Table' */ |
| 10459 | L4_MABX_B.uD_Lookup_Table_le = look2_binlcapw |
| 10460 | (L4_MABX_B.brake_system_avg_appl_pressure_, |
| 10461 | L4_MABX_B.SPN1760_GrossCombinationVehicle, BRK_GOV_FF_PRESS_KPA_STEP_MPV, |
| 10462 | BRK_GOV_FF_MASS_STEP_MPV, BRK_GOV_FF_DECEL_RATE_DATA_MPV, |
| 10463 | L4_MABX_P.uD_Lookup_Table_maxIndex_m, 16U); |
| 10464 | |
| 10465 | /* Saturate: '<S106>/Saturation4' */ |
| 10466 | DeltaTime = L4_MABX_B.uD_Lookup_Table_le; |
| 10467 | Time56 = L4_MABX_P.Saturation4_LowerSat_a; |
| 10468 | AccelerationAverage = L4_MABX_P.Saturation4_UpperSat_f; |
| 10469 | if (DeltaTime > AccelerationAverage) { |
| 10470 | L4_MABX_B.Decel_rate_calculated_ms2 = AccelerationAverage; |
| 10471 | } else if (DeltaTime < Time56) { |
| 10472 | L4_MABX_B.Decel_rate_calculated_ms2 = Time56; |
| 10473 | } else { |
| 10474 | L4_MABX_B.Decel_rate_calculated_ms2 = DeltaTime; |
| 10475 | } |
| 10476 | |
| 10477 | /* End of Saturate: '<S106>/Saturation4' */ |
| 10478 | |
| 10479 | /* DataTypeConversion: '<S107>/Data Type Conversion' */ |
| 10480 | L4_MABX_B.DataTypeConversion_pp = L4_MABX_B.SFunction1_o1_au; |
| 10481 | |
| 10482 | /* DataTypeConversion: '<S107>/Data Type Conversion1' */ |
| 10483 | L4_MABX_B.DataTypeConversion1_k = L4_MABX_B.SFunction1_o2_hu; |
| 10484 | |
| 10485 | /* Sum: '<S107>/Add' */ |
| 10486 | L4_MABX_B.Add_m = L4_MABX_B.DataTypeConversion_pp + |
| 10487 | L4_MABX_B.DataTypeConversion1_k; |
| 10488 | |
| 10489 | /* UnitDelay: '<S107>/Unit_Delay' */ |
| 10490 | L4_MABX_B.Unit_Delay_dy = L4_MABX_DW.Unit_Delay_DSTATE_eu4; |
| 10491 | |
| 10492 | /* UnitDelay: '<S203>/Unit_Delay1' */ |
| 10493 | L4_MABX_B.Unit_Delay1_k = L4_MABX_DW.Unit_Delay1_DSTATE_di; |
| 10494 | |
| 10495 | /* Logic: '<S203>/Logical Operator' */ |
| 10496 | L4_MABX_B.LogicalOperator_fc = (L4_MABX_B.Unit_Delay_dy || |
| 10497 | L4_MABX_B.Unit_Delay1_k); |
| 10498 | |
| 10499 | /* Gain: '<S107>/Gain' */ |
| 10500 | L4_MABX_B.Gain_j = L4_MABX_P.Gain_Gain_f * L4_MABX_B.Add_m; |
| 10501 | |
| 10502 | /* MinMax: '<S203>/MinMax1' incorporates: |
| 10503 | * Constant: '<S107>/Constant10' |
| 10504 | * Constant: '<S107>/VSPD_CAN_HRW_0B_FILT_T_APV' |
| 10505 | */ |
| 10506 | DeltaTime = L4_MABX_P.Constant10_Value; |
| 10507 | PositionFinalLimited = L4_MABX_P.VSPD_CAN_HRW_0B_FILT_T_APV_Valu; |
| 10508 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 10509 | PositionFinalLimited = DeltaTime; |
| 10510 | } |
| 10511 | |
| 10512 | L4_MABX_B.MinMax1_i = PositionFinalLimited; |
| 10513 | |
| 10514 | /* End of MinMax: '<S203>/MinMax1' */ |
| 10515 | |
| 10516 | /* Saturate: '<S203>/Saturation' */ |
| 10517 | DeltaTime = L4_MABX_B.MinMax1_i; |
| 10518 | Time56 = L4_MABX_P.Saturation_LowerSat_b; |
| 10519 | AccelerationAverage = L4_MABX_P.Saturation_UpperSat_l; |
| 10520 | if (DeltaTime > AccelerationAverage) { |
| 10521 | L4_MABX_B.Saturation_nc = AccelerationAverage; |
| 10522 | } else if (DeltaTime < Time56) { |
| 10523 | L4_MABX_B.Saturation_nc = Time56; |
| 10524 | } else { |
| 10525 | L4_MABX_B.Saturation_nc = DeltaTime; |
| 10526 | } |
| 10527 | |
| 10528 | /* End of Saturate: '<S203>/Saturation' */ |
| 10529 | |
| 10530 | /* Product: '<S203>/Divide' incorporates: |
| 10531 | * Constant: '<S107>/Constant10' |
| 10532 | */ |
| 10533 | L4_MABX_B.Divide_a = L4_MABX_P.Constant10_Value / L4_MABX_B.Saturation_nc; |
| 10534 | |
| 10535 | /* Product: '<S203>/Product2' */ |
| 10536 | L4_MABX_B.Product2_o = L4_MABX_B.Gain_j * L4_MABX_B.Divide_a; |
| 10537 | |
| 10538 | /* Sum: '<S203>/Subtract1' incorporates: |
| 10539 | * Constant: '<S203>/Constant1' |
| 10540 | */ |
| 10541 | L4_MABX_B.Subtract1_e = L4_MABX_P.Constant1_Value_od - L4_MABX_B.Divide_a; |
| 10542 | |
| 10543 | /* UnitDelay: '<S203>/Unit_Delay2' */ |
| 10544 | L4_MABX_B.Unit_Delay2_g = L4_MABX_DW.Unit_Delay2_DSTATE_e; |
| 10545 | |
| 10546 | /* Product: '<S203>/Product1' */ |
| 10547 | L4_MABX_B.Product1_o = L4_MABX_B.Subtract1_e * L4_MABX_B.Unit_Delay2_g; |
| 10548 | |
| 10549 | /* Sum: '<S203>/Add1' */ |
| 10550 | L4_MABX_B.Add1_n1 = L4_MABX_B.Product2_o + L4_MABX_B.Product1_o; |
| 10551 | |
| 10552 | /* Outputs for Atomic SubSystem: '<S203>/If_Then_Else' */ |
| 10553 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_fc, L4_MABX_B.Gain_j, |
| 10554 | L4_MABX_B.Add1_n1, &L4_MABX_B.If_Then_Else_g); |
| 10555 | |
| 10556 | /* End of Outputs for SubSystem: '<S203>/If_Then_Else' */ |
| 10557 | |
| 10558 | /* SampleTimeMath: '<S202>/TSamp' |
| 10559 | * |
| 10560 | * About '<S202>/TSamp': |
| 10561 | * y = u * K where K = 1 / ( w * Ts ) |
| 10562 | */ |
| 10563 | L4_MABX_B.TSamp = L4_MABX_B.If_Then_Else_g.Switch * L4_MABX_P.TSamp_WtEt; |
| 10564 | |
| 10565 | /* UnitDelay: '<S202>/UD' */ |
| 10566 | L4_MABX_B.Uk1_b = L4_MABX_DW.UD_DSTATE; |
| 10567 | |
| 10568 | /* Sum: '<S202>/Diff' */ |
| 10569 | L4_MABX_B.Diff = L4_MABX_B.TSamp - L4_MABX_B.Uk1_b; |
| 10570 | |
| 10571 | /* MinMax: '<S77>/MinMax' */ |
| 10572 | DeltaTime = L4_MABX_B.If_Then_Else_nj.Switch; |
| 10573 | PositionFinalLimited = L4_MABX_B.If_Then_Else_fo.Switch; |
| 10574 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 10575 | PositionFinalLimited = DeltaTime; |
| 10576 | } |
| 10577 | |
| 10578 | L4_MABX_B.BrakingPID_Y_percent = PositionFinalLimited; |
| 10579 | |
| 10580 | /* End of MinMax: '<S77>/MinMax' */ |
| 10581 | |
| 10582 | /* Gain: '<S77>/Gain' */ |
| 10583 | L4_MABX_B.BrakingPID_Y_k = L4_MABX_P.Gain_Gain_no * |
| 10584 | L4_MABX_B.BrakingPID_Y_percent; |
| 10585 | |
| 10586 | /* DataTypeConversion: '<S79>/Data Type Conversion' */ |
| 10587 | L4_MABX_B.DataTypeConversion_de = L4_MABX_B.AutonomousEnabled_d; |
| 10588 | |
| 10589 | /* DataTypeConversion: '<S79>/Data Type Conversion2' */ |
| 10590 | L4_MABX_B.DataTypeConversion2_lf = (real32_T)L4_MABX_B.SFunction1_o1_gd; |
| 10591 | |
| 10592 | /* DataTypeConversion: '<S79>/Data Type Conversion1' */ |
| 10593 | PositionFinalLimited = floor(L4_MABX_B.SFunction1_o8_fp); |
| 10594 | if (rtIsNaN(PositionFinalLimited) || rtIsInf(PositionFinalLimited)) { |
| 10595 | PositionFinalLimited = 0.0; |
| 10596 | } else { |
| 10597 | PositionFinalLimited = fmod(PositionFinalLimited, 256.0); |
| 10598 | } |
| 10599 | |
| 10600 | L4_MABX_B.DataTypeConversion1_f1 = (uint8_T)(PositionFinalLimited < 0.0 ? |
| 10601 | (int32_T)(uint8_T)-(int8_T)(uint8_T)-PositionFinalLimited : (int32_T) |
| 10602 | (uint8_T)PositionFinalLimited); |
| 10603 | |
| 10604 | /* End of DataTypeConversion: '<S79>/Data Type Conversion1' */ |
| 10605 | |
| 10606 | /* Chart: '<S79>/Chart' incorporates: |
| 10607 | * Constant: '<S79>/Constant' |
| 10608 | */ |
| 10609 | /* Gateway: STATE_CONTROL_10ms/Chart */ |
| 10610 | /* During: STATE_CONTROL_10ms/Chart */ |
| 10611 | if (L4_MABX_DW.is_active_c19_SUB_L4_Task_10ms_ == 0U) { |
| 10612 | /* Entry: STATE_CONTROL_10ms/Chart */ |
| 10613 | L4_MABX_DW.is_active_c19_SUB_L4_Task_10ms_ = 1U; |
| 10614 | |
| 10615 | /* Entry Internal: STATE_CONTROL_10ms/Chart */ |
| 10616 | /* Transition: '<S207>:2' */ |
| 10617 | L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA = L4_MABX_IN_Init; |
| 10618 | |
| 10619 | /* Entry 'Init': '<S207>:1' */ |
| 10620 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_INIT; |
| 10621 | } else { |
| 10622 | switch (L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA) { |
| 10623 | case L4_MABX_IN_Init: |
| 10624 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_INIT; |
| 10625 | |
| 10626 | /* During 'Init': '<S207>:1' */ |
| 10627 | if (!L4_MABX_P.Constant_Value_cp) { |
| 10628 | /* Transition: '<S207>:9' */ |
| 10629 | L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA = L4_MABX_IN_OperatorDisabled; |
| 10630 | |
| 10631 | /* Entry 'OperatorDisabled': '<S207>:3' */ |
| 10632 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_OPERATOR_DISABLED; |
| 10633 | } |
| 10634 | break; |
| 10635 | |
| 10636 | case L4_MABX_IN_OperatorDisabled: |
| 10637 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_OPERATOR_DISABLED; |
| 10638 | |
| 10639 | /* During 'OperatorDisabled': '<S207>:3' */ |
| 10640 | if (L4_MABX_B.DataTypeConversion_de) { |
| 10641 | /* Transition: '<S207>:11' */ |
| 10642 | L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA = L4_MABX_IN_OperatorEnabled; |
| 10643 | |
| 10644 | /* Entry 'OperatorEnabled': '<S207>:10' */ |
| 10645 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_AUTO_CTRL_ENABLED; |
| 10646 | |
| 10647 | /* Entry Internal 'OperatorEnabled': '<S207>:10' */ |
| 10648 | /* Transition: '<S207>:16' */ |
| 10649 | /* Entry 'AutoControlEnabled': '<S207>:13' */ |
| 10650 | /* Entry Internal 'AutoControlEnabled': '<S207>:13' */ |
| 10651 | /* Transition: '<S207>:15' */ |
| 10652 | /* Entry 'init': '<S207>:14' */ |
| 10653 | L4_MABX_B.VehCtrlState = ENUM_AUTO_CTRL_VEHICLE_STATE_T_INIT; |
| 10654 | } |
| 10655 | break; |
| 10656 | |
| 10657 | default: |
| 10658 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_AUTO_CTRL_ENABLED; |
| 10659 | |
| 10660 | /* During 'OperatorEnabled': '<S207>:10' */ |
| 10661 | if ((!L4_MABX_B.DataTypeConversion_de) || L4_MABX_P.Constant_Value_cp) { |
| 10662 | /* Transition: '<S207>:12' */ |
| 10663 | /* Exit Internal 'OperatorEnabled': '<S207>:10' */ |
| 10664 | /* Exit Internal 'AutoControlEnabled': '<S207>:13' */ |
| 10665 | L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA = L4_MABX_IN_OperatorDisabled; |
| 10666 | |
| 10667 | /* Entry 'OperatorDisabled': '<S207>:3' */ |
| 10668 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_OPERATOR_DISABLED; |
| 10669 | } else { |
| 10670 | /* During 'AutoControlEnabled': '<S207>:13' */ |
| 10671 | L4_MABX_B.VehCtrlState = ENUM_AUTO_CTRL_VEHICLE_STATE_T_INIT; |
| 10672 | |
| 10673 | /* During 'init': '<S207>:14' */ |
| 10674 | } |
| 10675 | break; |
| 10676 | } |
| 10677 | } |
| 10678 | |
| 10679 | /* End of Chart: '<S79>/Chart' */ |
| 10680 | |
| 10681 | /* Outputs for Enabled SubSystem: '<S79>/Engine_speed_target' incorporates: |
| 10682 | * EnablePort: '<S210>/Enable' |
| 10683 | */ |
| 10684 | if (L4_MABX_B.LogicalOperator_ke) { |
| 10685 | if (!L4_MABX_DW.Engine_speed_target_MODE) { |
| 10686 | L4_MABX_DW.Engine_speed_target_MODE = true; |
| 10687 | } |
| 10688 | |
| 10689 | /* Gain: '<S210>/KPH_TO_MPH' */ |
| 10690 | L4_MABX_B.KPH_TO_MPH = L4_MABX_P.KPH_TO_MPH_Gain * |
| 10691 | L4_MABX_B.VSPD_TARGET_KPH_APV_g; |
| 10692 | |
| 10693 | /* MinMax: '<S210>/MinMax' incorporates: |
| 10694 | * Constant: '<S210>/Constant2' |
| 10695 | * Constant: '<S210>/TIRE_DIAM_INCHES_APV' |
| 10696 | */ |
| 10697 | DeltaTime = L4_MABX_P.TIRE_DIAM_INCHES_APV_Value; |
| 10698 | PositionFinalLimited = L4_MABX_P.Constant2_Value_m; |
| 10699 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 10700 | PositionFinalLimited = DeltaTime; |
| 10701 | } |
| 10702 | |
| 10703 | L4_MABX_B.MinMax_dl = PositionFinalLimited; |
| 10704 | |
| 10705 | /* End of MinMax: '<S210>/MinMax' */ |
| 10706 | |
| 10707 | /* Product: '<S210>/Divide' incorporates: |
| 10708 | * Constant: '<S210>/CONVERSION_CONSTANT_CPV' |
| 10709 | * Constant: '<S210>/REAR_AXLE_RATIO_VALUE_APV' |
| 10710 | */ |
| 10711 | L4_MABX_B.Divide_p = L4_MABX_B.KPH_TO_MPH * |
| 10712 | L4_MABX_B.SPN526_TransActualGearRatio * |
| 10713 | L4_MABX_P.REAR_AXLE_RATIO_VALUE_APV_Value * |
| 10714 | L4_MABX_P.CONVERSION_CONSTANT_CPV_Value / L4_MABX_B.MinMax_dl; |
| 10715 | |
| 10716 | /* MinMax: '<S210>/MinMax1' incorporates: |
| 10717 | * Constant: '<S210>/Constant1' |
| 10718 | */ |
| 10719 | DeltaTime = L4_MABX_B.Divide_p; |
| 10720 | PositionFinalLimited = L4_MABX_P.Constant1_Value_fx; |
| 10721 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 10722 | PositionFinalLimited = DeltaTime; |
| 10723 | } |
| 10724 | |
| 10725 | L4_MABX_B.MinMax1_n = PositionFinalLimited; |
| 10726 | |
| 10727 | /* End of MinMax: '<S210>/MinMax1' */ |
| 10728 | } else { |
| 10729 | if (L4_MABX_DW.Engine_speed_target_MODE) { |
| 10730 | /* Disable for Outport: '<S210>/Out1' */ |
| 10731 | L4_MABX_B.MinMax1_n = L4_MABX_P.Out1_Y0; |
| 10732 | L4_MABX_DW.Engine_speed_target_MODE = false; |
| 10733 | } |
| 10734 | } |
| 10735 | |
| 10736 | /* End of Outputs for SubSystem: '<S79>/Engine_speed_target' */ |
| 10737 | |
| 10738 | /* RelationalOperator: '<S211>/Relational Operator1' incorporates: |
| 10739 | * Constant: '<S211>/CPV3' |
| 10740 | */ |
| 10741 | L4_MABX_B.RelationalOperator1_cn = (L4_MABX_B.SFunction1_o1_gd <= |
| 10742 | L4_MABX_P.CPV3_Value_n); |
| 10743 | |
| 10744 | /* RelationalOperator: '<S211>/Relational Operator3' incorporates: |
| 10745 | * Constant: '<S211>/CPV1' |
| 10746 | */ |
| 10747 | L4_MABX_B.RelationalOperator3_g = (L4_MABX_B.SPN524_TransSelectedGear == |
| 10748 | L4_MABX_P.CPV1_Value_n); |
| 10749 | |
| 10750 | /* RelationalOperator: '<S211>/Relational Operator2' incorporates: |
| 10751 | * Constant: '<S211>/CPV2' |
| 10752 | */ |
| 10753 | L4_MABX_B.RelationalOperator2_f = (L4_MABX_B.SPN523_TransCurrentGear == |
| 10754 | L4_MABX_P.CPV2_Value_h); |
| 10755 | |
| 10756 | /* RelationalOperator: '<S211>/Relational Operator4' incorporates: |
| 10757 | * Constant: '<S211>/CPV5' |
| 10758 | */ |
| 10759 | L4_MABX_B.RelationalOperator4_o = (L4_MABX_B.SFunction1_o2_bl == |
| 10760 | L4_MABX_P.CPV5_Value_g); |
| 10761 | |
| 10762 | /* Logic: '<S211>/Logical Operator' */ |
| 10763 | L4_MABX_B.F_Ignition_sw_off_conditions_me = (L4_MABX_B.RelationalOperator1_cn && |
| 10764 | L4_MABX_B.RelationalOperator3_g && L4_MABX_B.RelationalOperator2_f && |
| 10765 | L4_MABX_B.RelationalOperator4_o); |
| 10766 | |
| 10767 | /* RelationalOperator: '<S211>/Relational Operator' incorporates: |
| 10768 | * Constant: '<S211>/IGN_SW_VOLTAGE_THRESHOLD_APV' |
| 10769 | */ |
| 10770 | L4_MABX_B.F_Ignition_sw_on = (L4_MABX_B.IgnitionKeySwitch_voltage >= |
| 10771 | L4_MABX_P.IGN_SW_VOLTAGE_THRESHOLD_APV_Va); |
| 10772 | |
| 10773 | /* SignalConversion: '<S218>/TmpSignal ConversionAt SFunction Inport3' incorporates: |
| 10774 | * Chart: '<S211>/Relay_control_state_machine' |
| 10775 | * Constant: '<S211>/IGN_RELAY_ON_DELAY_SECS_APV' |
| 10776 | * Constant: '<S211>/INVERTER_RELAY_ON_DELAY_SECS_APV' |
| 10777 | * Constant: '<S211>/MABX_RELAY_ON_DELAY_SECS_APV' |
| 10778 | * Constant: '<S211>/SENSOR_RELAY_ON_DELAY_SECS_APV' |
| 10779 | */ |
| 10780 | L4_MABX_B.TmpSignalConversionAtSFunctionI[0] = |
| 10781 | L4_MABX_P.IGN_RELAY_ON_DELAY_SECS_APV_Val; |
| 10782 | L4_MABX_B.TmpSignalConversionAtSFunctionI[1] = |
| 10783 | L4_MABX_P.INVERTER_RELAY_ON_DELAY_SECS_AP; |
| 10784 | L4_MABX_B.TmpSignalConversionAtSFunctionI[2] = |
| 10785 | L4_MABX_P.MABX_RELAY_ON_DELAY_SECS_APV_Va; |
| 10786 | L4_MABX_B.TmpSignalConversionAtSFunctionI[3] = |
| 10787 | L4_MABX_P.SENSOR_RELAY_ON_DELAY_SECS_APV_; |
| 10788 | |
| 10789 | /* SignalConversion: '<S218>/TmpSignal ConversionAt SFunction Inport4' incorporates: |
| 10790 | * Chart: '<S211>/Relay_control_state_machine' |
| 10791 | * Constant: '<S211>/IGN_RELAY_OFF_DELAY_SECS_APV' |
| 10792 | * Constant: '<S211>/INVERTER_RELAY_OFF_DELAY_SECS_APV' |
| 10793 | * Constant: '<S211>/MABX_RELAY_OFF_DELAY_SECS_APV' |
| 10794 | * Constant: '<S211>/SENSOR_RELAY_OFF_DELAY_SECS_APV' |
| 10795 | */ |
| 10796 | L4_MABX_B.TmpSignalConversionAtSFunctio_k[0] = |
| 10797 | L4_MABX_P.IGN_RELAY_OFF_DELAY_SECS_APV_Va; |
| 10798 | L4_MABX_B.TmpSignalConversionAtSFunctio_k[1] = |
| 10799 | L4_MABX_P.INVERTER_RELAY_OFF_DELAY_SECS_A; |
| 10800 | L4_MABX_B.TmpSignalConversionAtSFunctio_k[2] = |
| 10801 | L4_MABX_P.MABX_RELAY_OFF_DELAY_SECS_APV_V; |
| 10802 | L4_MABX_B.TmpSignalConversionAtSFunctio_k[3] = |
| 10803 | L4_MABX_P.SENSOR_RELAY_OFF_DELAY_SECS_APV; |
| 10804 | |
| 10805 | /* Chart: '<S211>/Relay_control_state_machine' */ |
| 10806 | if (L4_MABX_DW.temporalCounter_i1 < MAX_uint32_T) { |
| 10807 | L4_MABX_DW.temporalCounter_i1++; |
| 10808 | } |
| 10809 | |
| 10810 | /* Gateway: STATE_CONTROL_10ms/Relay_control/Relay_control_state_machine */ |
| 10811 | /* During: STATE_CONTROL_10ms/Relay_control/Relay_control_state_machine */ |
| 10812 | if (L4_MABX_DW.is_active_c6_SUB_L4_Task_10ms_S == 0U) { |
| 10813 | /* Entry: STATE_CONTROL_10ms/Relay_control/Relay_control_state_machine */ |
| 10814 | L4_MABX_DW.is_active_c6_SUB_L4_Task_10ms_S = 1U; |
| 10815 | |
| 10816 | /* Entry Internal: STATE_CONTROL_10ms/Relay_control/Relay_control_state_machine */ |
| 10817 | /* Transition: '<S218>:13' */ |
| 10818 | L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT = L4_MABX_IN_INITIAL; |
| 10819 | L4_MABX_enter_atomic_INITIAL(); |
| 10820 | } else { |
| 10821 | switch (L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT) { |
| 10822 | case L4_MABX_IN_INITIAL: |
| 10823 | L4_MABX_B.F_Ignition_relay_command_i = false; |
| 10824 | L4_MABX_B.F_Inverter_relay_command_p = false; |
| 10825 | L4_MABX_B.F_MABX_relay_command_n = false; |
| 10826 | L4_MABX_B.F_Sensor_relay_command_k = false; |
| 10827 | |
| 10828 | /* During 'INITIAL': '<S218>:12' */ |
| 10829 | if (L4_MABX_B.F_Ignition_sw_on) { |
| 10830 | /* Transition: '<S218>:17' */ |
| 10831 | L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT = L4_MABX_IN_POWER_UP_ROUTINE; |
| 10832 | |
| 10833 | /* Entry Internal 'POWER_UP_ROUTINE': '<S218>:16' */ |
| 10834 | /* Transition: '<S218>:64' */ |
| 10835 | L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_WAIT; |
| 10836 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 10837 | } |
| 10838 | break; |
| 10839 | |
| 10840 | case L4_MABX_IN_POWER_DOWN_ROUTINE: |
| 10841 | /* During 'POWER_DOWN_ROUTINE': '<S218>:30' */ |
| 10842 | switch (L4_MABX_DW.is_POWER_DOWN_ROUTINE) { |
| 10843 | case L4_MABX_IN_IGN_RELAY_UNLATCH: |
| 10844 | L4_MABX_B.F_Ignition_relay_command_i = false; |
| 10845 | |
| 10846 | /* During 'IGN_RELAY_UNLATCH': '<S218>:29' */ |
| 10847 | if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil |
| 10848 | (L4_MABX_DW.INVERTER_RELAY_OFF_DELAY_SECS_A * 100.0)) { |
| 10849 | /* Transition: '<S218>:23' */ |
| 10850 | L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_INV_RELAY_UNLATCH; |
| 10851 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 10852 | |
| 10853 | /* Entry 'INV_RELAY_UNLATCH': '<S218>:28' */ |
| 10854 | L4_MABX_B.F_Inverter_relay_command_p = false; |
| 10855 | } |
| 10856 | break; |
| 10857 | |
| 10858 | case L4_MABX_IN_INV_RELAY_UNLATCH: |
| 10859 | L4_MABX_B.F_Inverter_relay_command_p = false; |
| 10860 | |
| 10861 | /* During 'INV_RELAY_UNLATCH': '<S218>:28' */ |
| 10862 | if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil |
| 10863 | (L4_MABX_DW.SENSOR_RELAY_OFF_DELAY_SECS_APV * 100.0)) { |
| 10864 | /* Transition: '<S218>:22' */ |
| 10865 | L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_SENSOR_RELAY_UNLATCH; |
| 10866 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 10867 | |
| 10868 | /* Entry 'SENSOR_RELAY_UNLATCH': '<S218>:25' */ |
| 10869 | L4_MABX_B.F_Sensor_relay_command_k = false; |
| 10870 | } |
| 10871 | break; |
| 10872 | |
| 10873 | case L4_MABX_IN_MABX_RELAY_UNLATCH: |
| 10874 | L4_MABX_B.F_MABX_relay_command_n = false; |
| 10875 | |
| 10876 | /* During 'MABX_RELAY_UNLATCH': '<S218>:27' */ |
| 10877 | /* Transition: '<S218>:45' */ |
| 10878 | /* Transition: '<S218>:46' */ |
| 10879 | /* Transition: '<S218>:47' */ |
| 10880 | /* Transition: '<S218>:48' */ |
| 10881 | L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 10882 | L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT = L4_MABX_IN_INITIAL; |
| 10883 | L4_MABX_enter_atomic_INITIAL(); |
| 10884 | break; |
| 10885 | |
| 10886 | case L4_MABX_IN_SENSOR_RELAY_UNLATCH: |
| 10887 | L4_MABX_B.F_Sensor_relay_command_k = false; |
| 10888 | |
| 10889 | /* During 'SENSOR_RELAY_UNLATCH': '<S218>:25' */ |
| 10890 | if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil |
| 10891 | (L4_MABX_DW.MABX_RELAY_OFF_DELAY_SECS_APV * 100.0)) { |
| 10892 | /* Transition: '<S218>:26' */ |
| 10893 | L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_MABX_RELAY_UNLATCH; |
| 10894 | |
| 10895 | /* Entry 'MABX_RELAY_UNLATCH': '<S218>:27' */ |
| 10896 | L4_MABX_B.F_MABX_relay_command_n = false; |
| 10897 | } |
| 10898 | break; |
| 10899 | |
| 10900 | default: |
| 10901 | /* During 'WAIT': '<S218>:65' */ |
| 10902 | if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil |
| 10903 | (L4_MABX_DW.IGN_RELAY_OFF_DELAY_SECS_APV * 100.0)) { |
| 10904 | /* Transition: '<S218>:55' */ |
| 10905 | L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_IGN_RELAY_UNLATCH; |
| 10906 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 10907 | |
| 10908 | /* Entry 'IGN_RELAY_UNLATCH': '<S218>:29' */ |
| 10909 | L4_MABX_B.F_Ignition_relay_command_i = false; |
| 10910 | } |
| 10911 | break; |
| 10912 | } |
| 10913 | break; |
| 10914 | |
| 10915 | default: |
| 10916 | /* During 'POWER_UP_ROUTINE': '<S218>:16' */ |
| 10917 | zcEvent = ((!L4_MABX_B.F_Ignition_sw_on) && |
| 10918 | L4_MABX_B.F_Ignition_sw_off_conditions_me); |
| 10919 | if (zcEvent) { |
| 10920 | /* Transition: '<S218>:31' */ |
| 10921 | /* Exit Internal 'POWER_UP_ROUTINE': '<S218>:16' */ |
| 10922 | L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 10923 | L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT = |
| 10924 | L4_MABX_IN_POWER_DOWN_ROUTINE; |
| 10925 | |
| 10926 | /* Entry Internal 'POWER_DOWN_ROUTINE': '<S218>:30' */ |
| 10927 | /* Transition: '<S218>:66' */ |
| 10928 | L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_WAIT; |
| 10929 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 10930 | } else { |
| 10931 | switch (L4_MABX_DW.is_POWER_UP_ROUTINE) { |
| 10932 | case L4_MABX_IN_IGN_RELAY_LATCH: |
| 10933 | L4_MABX_B.F_Ignition_relay_command_i = true; |
| 10934 | |
| 10935 | /* During 'IGN_RELAY_LATCH': '<S218>:20' */ |
| 10936 | break; |
| 10937 | |
| 10938 | case L4_MABX_IN_INV_RELAY_LATCH: |
| 10939 | L4_MABX_B.F_Inverter_relay_command_p = true; |
| 10940 | |
| 10941 | /* During 'INV_RELAY_LATCH': '<S218>:19' */ |
| 10942 | if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil |
| 10943 | (L4_MABX_DW.IGN_RELAY_ON_DELAY_SECS_APV * 100.0)) { |
| 10944 | /* Transition: '<S218>:21' */ |
| 10945 | L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_IGN_RELAY_LATCH; |
| 10946 | |
| 10947 | /* Entry 'IGN_RELAY_LATCH': '<S218>:20' */ |
| 10948 | L4_MABX_B.F_Ignition_relay_command_i = true; |
| 10949 | } |
| 10950 | break; |
| 10951 | |
| 10952 | case L4_MABX_IN_MABX_RELAY_LATCH: |
| 10953 | L4_MABX_B.F_MABX_relay_command_n = true; |
| 10954 | |
| 10955 | /* During 'MABX_RELAY_LATCH': '<S218>:10' */ |
| 10956 | if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil |
| 10957 | (L4_MABX_DW.SENSOR_RELAY_ON_DELAY_SECS_APV * 100.0)) { |
| 10958 | /* Transition: '<S218>:15' */ |
| 10959 | L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_SENSOR_RELAY_LATCH; |
| 10960 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 10961 | |
| 10962 | /* Entry 'SENSOR_RELAY_LATCH': '<S218>:14' */ |
| 10963 | L4_MABX_B.F_Sensor_relay_command_k = true; |
| 10964 | } |
| 10965 | break; |
| 10966 | |
| 10967 | case L4_MABX_IN_SENSOR_RELAY_LATCH: |
| 10968 | L4_MABX_B.F_Sensor_relay_command_k = true; |
| 10969 | |
| 10970 | /* During 'SENSOR_RELAY_LATCH': '<S218>:14' */ |
| 10971 | if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil |
| 10972 | (L4_MABX_DW.INVERTER_RELAY_ON_DELAY_SECS_AP * 100.0)) { |
| 10973 | /* Transition: '<S218>:18' */ |
| 10974 | L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_INV_RELAY_LATCH; |
| 10975 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 10976 | |
| 10977 | /* Entry 'INV_RELAY_LATCH': '<S218>:19' */ |
| 10978 | L4_MABX_B.F_Inverter_relay_command_p = true; |
| 10979 | } |
| 10980 | break; |
| 10981 | |
| 10982 | default: |
| 10983 | /* During 'WAIT': '<S218>:63' */ |
| 10984 | if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil |
| 10985 | (L4_MABX_DW.MABX_RELAY_ON_DELAY_SECS_APV * 100.0)) { |
| 10986 | /* Transition: '<S218>:11' */ |
| 10987 | L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_MABX_RELAY_LATCH; |
| 10988 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 10989 | |
| 10990 | /* Entry 'MABX_RELAY_LATCH': '<S218>:10' */ |
| 10991 | L4_MABX_B.F_MABX_relay_command_n = true; |
| 10992 | } |
| 10993 | break; |
| 10994 | } |
| 10995 | } |
| 10996 | break; |
| 10997 | } |
| 10998 | } |
| 10999 | |
| 11000 | /* Lookup_n-D: '<S79>/CurveBasedSpeedSetpoint' incorporates: |
| 11001 | * Constant: '<S80>/zero' |
| 11002 | */ |
| 11003 | L4_MABX_B.CurveBasedSpeedSetpoint = look1_binlcapw(L4_MABX_P.zero_Value, |
| 11004 | L4_MABX_P.CurveBasedSpeedSetpoint_bp01Dat, |
| 11005 | L4_MABX_P.CurveBasedSpeedSetpoint_tableDa, 4U); |
| 11006 | |
| 11007 | /* Lookup_n-D: '<S80>/1-D Lookup Table1' */ |
| 11008 | L4_MABX_B.uDLookupTable1 = look1_binlxpw(SteerWheelAngle, |
| 11009 | L4_MABX_P.uDLookupTable1_bp01Data, L4_MABX_P.uDLookupTable1_tableData, 16U); |
| 11010 | |
| 11011 | /* Product: '<S285>/Divide' incorporates: |
| 11012 | * Constant: '<S277>/Constant' |
| 11013 | * Constant: '<S277>/Constant1' |
| 11014 | */ |
| 11015 | L4_MABX_B.Divide_nn = (real32_T)(L4_MABX_P.Constant1_Value_i / |
| 11016 | L4_MABX_P.Constant_Value_e); |
| 11017 | |
| 11018 | /* DataTypeConversion: '<S80>/Data Type Conversion5' */ |
| 11019 | PositionFinalLimited = floor(L4_MABX_B.SFunction1_o2_mr); |
| 11020 | if (rtIsNaN(PositionFinalLimited) || rtIsInf(PositionFinalLimited)) { |
| 11021 | PositionFinalLimited = 0.0; |
| 11022 | } else { |
| 11023 | PositionFinalLimited = fmod(PositionFinalLimited, 256.0); |
| 11024 | } |
| 11025 | |
| 11026 | L4_MABX_B.DataTypeConversion5_e3 = (uint8_T)(PositionFinalLimited < 0.0 ? |
| 11027 | (int32_T)(uint8_T)-(int8_T)(uint8_T)-PositionFinalLimited : (int32_T) |
| 11028 | (uint8_T)PositionFinalLimited); |
| 11029 | |
| 11030 | /* End of DataTypeConversion: '<S80>/Data Type Conversion5' */ |
| 11031 | |
| 11032 | /* Chart: '<S283>/Chart' */ |
| 11033 | /* Gateway: STEERCTRL_10ms/slew/Chart */ |
| 11034 | /* During: STEERCTRL_10ms/slew/Chart */ |
| 11035 | if (L4_MABX_DW.is_active_c12_SUB_L4_Task_10ms_ == 0U) { |
| 11036 | /* Entry: STEERCTRL_10ms/slew/Chart */ |
| 11037 | L4_MABX_DW.is_active_c12_SUB_L4_Task_10ms_ = 1U; |
| 11038 | |
| 11039 | /* Entry Internal: STEERCTRL_10ms/slew/Chart */ |
| 11040 | /* Transition: '<S339>:4' */ |
| 11041 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_init_a; |
| 11042 | |
| 11043 | /* Entry 'init': '<S339>:1' */ |
| 11044 | L4_MABX_B.stateChange = 0U; |
| 11045 | } else { |
| 11046 | switch (L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE) { |
| 11047 | case L4_MABX_IN_OneLane: |
| 11048 | /* During 'OneLane': '<S339>:7' */ |
| 11049 | /* Transition: '<S339>:20' */ |
| 11050 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_OneLane1; |
| 11051 | |
| 11052 | /* Entry 'OneLane1': '<S339>:18' */ |
| 11053 | L4_MABX_B.stateChange = 0U; |
| 11054 | break; |
| 11055 | |
| 11056 | case L4_MABX_IN_OneLane1: |
| 11057 | L4_MABX_B.stateChange = 0U; |
| 11058 | |
| 11059 | /* During 'OneLane1': '<S339>:18' */ |
| 11060 | zcEvent = ((L4_MABX_B.DataTypeConversion5_e3 < 3) || |
| 11061 | (L4_MABX_B.DataTypeConversion5_e3 > 18)); |
| 11062 | if (zcEvent) { |
| 11063 | /* Transition: '<S339>:22' */ |
| 11064 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_init_a; |
| 11065 | |
| 11066 | /* Entry 'init': '<S339>:1' */ |
| 11067 | L4_MABX_B.stateChange = 0U; |
| 11068 | } |
| 11069 | break; |
| 11070 | |
| 11071 | case L4_MABX_IN_TwoLanes: |
| 11072 | /* During 'TwoLanes': '<S339>:8' */ |
| 11073 | /* Transition: '<S339>:21' */ |
| 11074 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_TwoLanes1; |
| 11075 | |
| 11076 | /* Entry 'TwoLanes1': '<S339>:19' */ |
| 11077 | L4_MABX_B.stateChange = 0U; |
| 11078 | break; |
| 11079 | |
| 11080 | case L4_MABX_IN_TwoLanes1: |
| 11081 | L4_MABX_B.stateChange = 0U; |
| 11082 | |
| 11083 | /* During 'TwoLanes1': '<S339>:19' */ |
| 11084 | if (L4_MABX_B.DataTypeConversion5_e3 < 18) { |
| 11085 | /* Transition: '<S339>:23' */ |
| 11086 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_init_a; |
| 11087 | |
| 11088 | /* Entry 'init': '<S339>:1' */ |
| 11089 | L4_MABX_B.stateChange = 0U; |
| 11090 | } |
| 11091 | break; |
| 11092 | |
| 11093 | case L4_MABX_IN_ZeroLanes: |
| 11094 | /* During 'ZeroLanes': '<S339>:5' */ |
| 11095 | /* Transition: '<S339>:16' */ |
| 11096 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_ZeroLanes1; |
| 11097 | |
| 11098 | /* Entry 'ZeroLanes1': '<S339>:15' */ |
| 11099 | L4_MABX_B.stateChange = 0U; |
| 11100 | break; |
| 11101 | |
| 11102 | case L4_MABX_IN_ZeroLanes1: |
| 11103 | L4_MABX_B.stateChange = 0U; |
| 11104 | |
| 11105 | /* During 'ZeroLanes1': '<S339>:15' */ |
| 11106 | if (L4_MABX_B.DataTypeConversion5_e3 > 3) { |
| 11107 | /* Transition: '<S339>:17' */ |
| 11108 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_init_a; |
| 11109 | |
| 11110 | /* Entry 'init': '<S339>:1' */ |
| 11111 | L4_MABX_B.stateChange = 0U; |
| 11112 | } |
| 11113 | break; |
| 11114 | |
| 11115 | default: |
| 11116 | L4_MABX_B.stateChange = 0U; |
| 11117 | |
| 11118 | /* During 'init': '<S339>:1' */ |
| 11119 | if (L4_MABX_B.DataTypeConversion5_e3 <= 3) { |
| 11120 | /* Transition: '<S339>:6' */ |
| 11121 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_ZeroLanes; |
| 11122 | |
| 11123 | /* Entry 'ZeroLanes': '<S339>:5' */ |
| 11124 | L4_MABX_B.stateChange = 1U; |
| 11125 | } else if (L4_MABX_B.DataTypeConversion5_e3 > 18) { |
| 11126 | /* Transition: '<S339>:9' */ |
| 11127 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_TwoLanes; |
| 11128 | |
| 11129 | /* Entry 'TwoLanes': '<S339>:8' */ |
| 11130 | L4_MABX_B.stateChange = 1U; |
| 11131 | } else { |
| 11132 | if (L4_MABX_B.DataTypeConversion5_e3 > 3) { |
| 11133 | /* Transition: '<S339>:10' */ |
| 11134 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_OneLane; |
| 11135 | |
| 11136 | /* Entry 'OneLane': '<S339>:7' */ |
| 11137 | L4_MABX_B.stateChange = 1U; |
| 11138 | } |
| 11139 | } |
| 11140 | break; |
| 11141 | } |
| 11142 | } |
| 11143 | |
| 11144 | /* End of Chart: '<S283>/Chart' */ |
| 11145 | |
| 11146 | /* DataTypeConversion: '<S283>/Data Type Conversion' */ |
| 11147 | L4_MABX_B.DataTypeConversion_l1 = (L4_MABX_B.stateChange != 0); |
| 11148 | |
| 11149 | /* UnitDelay: '<S333>/Unit_Delay1' */ |
| 11150 | L4_MABX_B.Unit_Delay1_j = L4_MABX_DW.Unit_Delay1_DSTATE_db; |
| 11151 | |
| 11152 | /* Logic: '<S333>/Logical Operator' incorporates: |
| 11153 | * Constant: '<S282>/zero' |
| 11154 | */ |
| 11155 | L4_MABX_B.LogicalOperator_kh = (L4_MABX_P.zero_Value_g || |
| 11156 | L4_MABX_B.Unit_Delay1_j); |
| 11157 | |
| 11158 | /* MinMax: '<S333>/MinMax1' incorporates: |
| 11159 | * Constant: '<S282>/timeConstant' |
| 11160 | * Constant: '<S282>/timeConstant1' |
| 11161 | */ |
| 11162 | DeltaTime = L4_MABX_P.timeConstant1_Value; |
| 11163 | PositionFinalLimited = L4_MABX_P.timeConstant_Value; |
| 11164 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 11165 | PositionFinalLimited = DeltaTime; |
| 11166 | } |
| 11167 | |
| 11168 | L4_MABX_B.MinMax1_pr = PositionFinalLimited; |
| 11169 | |
| 11170 | /* End of MinMax: '<S333>/MinMax1' */ |
| 11171 | |
| 11172 | /* Saturate: '<S333>/Saturation' */ |
| 11173 | DeltaTime = L4_MABX_B.MinMax1_pr; |
| 11174 | Time56 = L4_MABX_P.Saturation_LowerSat_p2; |
| 11175 | AccelerationAverage = L4_MABX_P.Saturation_UpperSat_o1; |
| 11176 | if (DeltaTime > AccelerationAverage) { |
| 11177 | L4_MABX_B.Saturation_ns = AccelerationAverage; |
| 11178 | } else if (DeltaTime < Time56) { |
| 11179 | L4_MABX_B.Saturation_ns = Time56; |
| 11180 | } else { |
| 11181 | L4_MABX_B.Saturation_ns = DeltaTime; |
| 11182 | } |
| 11183 | |
| 11184 | /* End of Saturate: '<S333>/Saturation' */ |
| 11185 | |
| 11186 | /* Product: '<S333>/Divide' incorporates: |
| 11187 | * Constant: '<S282>/timeConstant1' |
| 11188 | */ |
| 11189 | L4_MABX_B.Divide_o = L4_MABX_P.timeConstant1_Value / L4_MABX_B.Saturation_ns; |
| 11190 | |
| 11191 | /* Product: '<S333>/Product2' */ |
| 11192 | L4_MABX_B.Product2_b = L4_MABX_B.SFunction1_o3_ev * L4_MABX_B.Divide_o; |
| 11193 | |
| 11194 | /* Sum: '<S333>/Subtract1' incorporates: |
| 11195 | * Constant: '<S333>/Constant1' |
| 11196 | */ |
| 11197 | L4_MABX_B.Subtract1_ei = L4_MABX_P.Constant1_Value_n - L4_MABX_B.Divide_o; |
| 11198 | |
| 11199 | /* UnitDelay: '<S333>/Unit_Delay2' */ |
| 11200 | L4_MABX_B.Unit_Delay2_k = L4_MABX_DW.Unit_Delay2_DSTATE_d; |
| 11201 | |
| 11202 | /* Product: '<S333>/Product1' */ |
| 11203 | L4_MABX_B.Product1_n = L4_MABX_B.Subtract1_ei * L4_MABX_B.Unit_Delay2_k; |
| 11204 | |
| 11205 | /* Sum: '<S333>/Add1' */ |
| 11206 | L4_MABX_B.Add1_k = L4_MABX_B.Product2_b + L4_MABX_B.Product1_n; |
| 11207 | |
| 11208 | /* Outputs for Atomic SubSystem: '<S333>/If_Then_Else' */ |
| 11209 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_kh, L4_MABX_B.SFunction1_o3_ev, |
| 11210 | L4_MABX_B.Add1_k, &L4_MABX_B.If_Then_Else_b3); |
| 11211 | |
| 11212 | /* End of Outputs for SubSystem: '<S333>/If_Then_Else' */ |
| 11213 | |
| 11214 | /* Abs: '<S282>/Abs' */ |
| 11215 | L4_MABX_B.Abs_ij = fabs(L4_MABX_B.SFunction1_o3_ev); |
| 11216 | |
| 11217 | /* Sum: '<S282>/Add' */ |
| 11218 | L4_MABX_B.Add_p = L4_MABX_B.Abs_ij - L4_MABX_B.If_Then_Else_b3.Switch; |
| 11219 | |
| 11220 | /* RelationalOperator: '<S282>/highRateOfChange' incorporates: |
| 11221 | * Constant: '<S282>/rateOfChangeThreshold' |
| 11222 | */ |
| 11223 | L4_MABX_B.highRateOfChange = (L4_MABX_B.Add_p > |
| 11224 | L4_MABX_P.rateOfChangeThreshold_Value); |
| 11225 | |
| 11226 | /* RelationalOperator: '<S282>/closeToEdge' incorporates: |
| 11227 | * Constant: '<S282>/closeToLaneEdgeThreshold' |
| 11228 | */ |
| 11229 | L4_MABX_B.closeToEdge = (L4_MABX_B.Abs_ij > |
| 11230 | L4_MABX_P.closeToLaneEdgeThreshold_Value); |
| 11231 | |
| 11232 | /* Logic: '<S282>/JumpNearEdge' */ |
| 11233 | L4_MABX_B.JumpNearEdge = (L4_MABX_B.highRateOfChange && L4_MABX_B.closeToEdge); |
| 11234 | |
| 11235 | /* UnitDelay: '<S332>/Delay Input1' */ |
| 11236 | L4_MABX_B.Uk1_k2 = L4_MABX_DW.DelayInput1_DSTATE_f0; |
| 11237 | |
| 11238 | /* RelationalOperator: '<S332>/FixPt Relational Operator' */ |
| 11239 | L4_MABX_B.FixPtRelationalOperator_iv = (L4_MABX_B.JumpNearEdge != |
| 11240 | L4_MABX_B.Uk1_k2); |
| 11241 | |
| 11242 | /* DataTypeConversion: '<S282>/Data Type Conversion' */ |
| 11243 | L4_MABX_B.DataTypeConversion_dz = L4_MABX_B.FixPtRelationalOperator_iv; |
| 11244 | |
| 11245 | /* UnitDelay: '<S334>/Unit_Delay1' */ |
| 11246 | L4_MABX_B.Unit_Delay1_f = L4_MABX_DW.Unit_Delay1_DSTATE_a; |
| 11247 | |
| 11248 | /* Logic: '<S334>/Logical Operator' */ |
| 11249 | L4_MABX_B.LogicalOperator_a = (L4_MABX_B.DataTypeConversion_dz || |
| 11250 | L4_MABX_B.Unit_Delay1_f); |
| 11251 | |
| 11252 | /* Switch: '<S282>/Switch' incorporates: |
| 11253 | * Constant: '<S282>/correction' |
| 11254 | * Constant: '<S282>/zero1' |
| 11255 | */ |
| 11256 | if (L4_MABX_B.JumpNearEdge) { |
| 11257 | L4_MABX_B.Switch_g = L4_MABX_P.correction_Value; |
| 11258 | } else { |
| 11259 | L4_MABX_B.Switch_g = L4_MABX_P.zero1_Value; |
| 11260 | } |
| 11261 | |
| 11262 | /* End of Switch: '<S282>/Switch' */ |
| 11263 | |
| 11264 | /* MinMax: '<S334>/MinMax1' incorporates: |
| 11265 | * Constant: '<S282>/timeConstant2' |
| 11266 | * Constant: '<S282>/timeConstant3' |
| 11267 | */ |
| 11268 | DeltaTime = L4_MABX_P.timeConstant3_Value; |
| 11269 | PositionFinalLimited = L4_MABX_P.timeConstant2_Value; |
| 11270 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 11271 | PositionFinalLimited = DeltaTime; |
| 11272 | } |
| 11273 | |
| 11274 | L4_MABX_B.MinMax1_au = PositionFinalLimited; |
| 11275 | |
| 11276 | /* End of MinMax: '<S334>/MinMax1' */ |
| 11277 | |
| 11278 | /* Saturate: '<S334>/Saturation' */ |
| 11279 | DeltaTime = L4_MABX_B.MinMax1_au; |
| 11280 | Time56 = L4_MABX_P.Saturation_LowerSat_ph; |
| 11281 | AccelerationAverage = L4_MABX_P.Saturation_UpperSat_d; |
| 11282 | if (DeltaTime > AccelerationAverage) { |
| 11283 | L4_MABX_B.Saturation_e = AccelerationAverage; |
| 11284 | } else if (DeltaTime < Time56) { |
| 11285 | L4_MABX_B.Saturation_e = Time56; |
| 11286 | } else { |
| 11287 | L4_MABX_B.Saturation_e = DeltaTime; |
| 11288 | } |
| 11289 | |
| 11290 | /* End of Saturate: '<S334>/Saturation' */ |
| 11291 | |
| 11292 | /* Product: '<S334>/Divide' incorporates: |
| 11293 | * Constant: '<S282>/timeConstant3' |
| 11294 | */ |
| 11295 | L4_MABX_B.Divide_d = L4_MABX_P.timeConstant3_Value / L4_MABX_B.Saturation_e; |
| 11296 | |
| 11297 | /* Product: '<S334>/Product2' */ |
| 11298 | L4_MABX_B.Product2_f = L4_MABX_B.Switch_g * L4_MABX_B.Divide_d; |
| 11299 | |
| 11300 | /* Sum: '<S334>/Subtract1' incorporates: |
| 11301 | * Constant: '<S334>/Constant1' |
| 11302 | */ |
| 11303 | L4_MABX_B.Subtract1_b = L4_MABX_P.Constant1_Value_j - L4_MABX_B.Divide_d; |
| 11304 | |
| 11305 | /* UnitDelay: '<S334>/Unit_Delay2' */ |
| 11306 | L4_MABX_B.Unit_Delay2_l = L4_MABX_DW.Unit_Delay2_DSTATE_i; |
| 11307 | |
| 11308 | /* Product: '<S334>/Product1' */ |
| 11309 | L4_MABX_B.Product1_c = L4_MABX_B.Subtract1_b * L4_MABX_B.Unit_Delay2_l; |
| 11310 | |
| 11311 | /* Sum: '<S334>/Add1' */ |
| 11312 | L4_MABX_B.Add1_pt = L4_MABX_B.Product2_f + L4_MABX_B.Product1_c; |
| 11313 | |
| 11314 | /* Outputs for Atomic SubSystem: '<S334>/If_Then_Else' */ |
| 11315 | |
| 11316 | /* Constant: '<S282>/zero2' */ |
| 11317 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_a, L4_MABX_P.zero2_Value, |
| 11318 | L4_MABX_B.Add1_pt, &L4_MABX_B.If_Then_Else_mk); |
| 11319 | |
| 11320 | /* End of Outputs for SubSystem: '<S334>/If_Then_Else' */ |
| 11321 | |
| 11322 | /* Signum: '<S282>/Sign' */ |
| 11323 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_ev; |
| 11324 | if (PositionFinalLimited < 0.0) { |
| 11325 | L4_MABX_B.Sign = -1.0; |
| 11326 | } else if (PositionFinalLimited > 0.0) { |
| 11327 | L4_MABX_B.Sign = 1.0; |
| 11328 | } else if (PositionFinalLimited == 0.0) { |
| 11329 | L4_MABX_B.Sign = 0.0; |
| 11330 | } else { |
| 11331 | L4_MABX_B.Sign = (rtNaN); |
| 11332 | } |
| 11333 | |
| 11334 | /* End of Signum: '<S282>/Sign' */ |
| 11335 | |
| 11336 | /* Product: '<S282>/Product' */ |
| 11337 | L4_MABX_B.Product_cf = L4_MABX_B.If_Then_Else_mk.Switch * L4_MABX_B.Sign; |
| 11338 | |
| 11339 | /* UnitDelay: '<S335>/Unit_Delay1' */ |
| 11340 | L4_MABX_B.Unit_Delay1_de = L4_MABX_DW.Unit_Delay1_DSTATE_p3; |
| 11341 | |
| 11342 | /* Logic: '<S335>/Logical Operator' incorporates: |
| 11343 | * Constant: '<S282>/zero3' |
| 11344 | */ |
| 11345 | L4_MABX_B.LogicalOperator_nz = (L4_MABX_P.zero3_Value || |
| 11346 | L4_MABX_B.Unit_Delay1_de); |
| 11347 | |
| 11348 | /* MinMax: '<S335>/MinMax1' incorporates: |
| 11349 | * Constant: '<S282>/timeConstant4' |
| 11350 | * Constant: '<S282>/timeConstant5' |
| 11351 | */ |
| 11352 | DeltaTime = L4_MABX_P.timeConstant5_Value; |
| 11353 | PositionFinalLimited = L4_MABX_P.timeConstant4_Value; |
| 11354 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 11355 | PositionFinalLimited = DeltaTime; |
| 11356 | } |
| 11357 | |
| 11358 | L4_MABX_B.MinMax1_e0 = PositionFinalLimited; |
| 11359 | |
| 11360 | /* End of MinMax: '<S335>/MinMax1' */ |
| 11361 | |
| 11362 | /* Saturate: '<S335>/Saturation' */ |
| 11363 | DeltaTime = L4_MABX_B.MinMax1_e0; |
| 11364 | Time56 = L4_MABX_P.Saturation_LowerSat_k; |
| 11365 | AccelerationAverage = L4_MABX_P.Saturation_UpperSat_ok; |
| 11366 | if (DeltaTime > AccelerationAverage) { |
| 11367 | L4_MABX_B.Saturation_o = AccelerationAverage; |
| 11368 | } else if (DeltaTime < Time56) { |
| 11369 | L4_MABX_B.Saturation_o = Time56; |
| 11370 | } else { |
| 11371 | L4_MABX_B.Saturation_o = DeltaTime; |
| 11372 | } |
| 11373 | |
| 11374 | /* End of Saturate: '<S335>/Saturation' */ |
| 11375 | |
| 11376 | /* Product: '<S335>/Divide' incorporates: |
| 11377 | * Constant: '<S282>/timeConstant5' |
| 11378 | */ |
| 11379 | L4_MABX_B.Divide_j = L4_MABX_P.timeConstant5_Value / L4_MABX_B.Saturation_o; |
| 11380 | |
| 11381 | /* Product: '<S335>/Product2' */ |
| 11382 | L4_MABX_B.Product2_nk = L4_MABX_B.SFunction1_o3_ev * L4_MABX_B.Divide_j; |
| 11383 | |
| 11384 | /* Sum: '<S335>/Subtract1' incorporates: |
| 11385 | * Constant: '<S335>/Constant1' |
| 11386 | */ |
| 11387 | L4_MABX_B.Subtract1_eh = L4_MABX_P.Constant1_Value_oi - L4_MABX_B.Divide_j; |
| 11388 | |
| 11389 | /* UnitDelay: '<S335>/Unit_Delay2' */ |
| 11390 | L4_MABX_B.Unit_Delay2_c = L4_MABX_DW.Unit_Delay2_DSTATE_p; |
| 11391 | |
| 11392 | /* Product: '<S335>/Product1' */ |
| 11393 | L4_MABX_B.Product1_cc = L4_MABX_B.Subtract1_eh * L4_MABX_B.Unit_Delay2_c; |
| 11394 | |
| 11395 | /* Sum: '<S335>/Add1' */ |
| 11396 | L4_MABX_B.Add1_f = L4_MABX_B.Product2_nk + L4_MABX_B.Product1_cc; |
| 11397 | |
| 11398 | /* Outputs for Atomic SubSystem: '<S335>/If_Then_Else' */ |
| 11399 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_nz, L4_MABX_B.SFunction1_o3_ev, |
| 11400 | L4_MABX_B.Add1_f, &L4_MABX_B.If_Then_Else_lh); |
| 11401 | |
| 11402 | /* End of Outputs for SubSystem: '<S335>/If_Then_Else' */ |
| 11403 | |
| 11404 | /* Switch: '<S282>/Switch1' */ |
| 11405 | if (L4_MABX_B.JumpNearEdge) { |
| 11406 | L4_MABX_B.Switch1_f = L4_MABX_B.If_Then_Else_lh.Switch; |
| 11407 | } else { |
| 11408 | L4_MABX_B.Switch1_f = L4_MABX_B.SFunction1_o3_ev; |
| 11409 | } |
| 11410 | |
| 11411 | /* End of Switch: '<S282>/Switch1' */ |
| 11412 | |
| 11413 | /* Sum: '<S282>/corrected Error' */ |
| 11414 | L4_MABX_B.correctedError = L4_MABX_B.Product_cf + L4_MABX_B.Switch1_f; |
| 11415 | |
| 11416 | /* RelationalOperator: '<S283>/Relational Operator' incorporates: |
| 11417 | * Constant: '<S283>/Constant' |
| 11418 | */ |
| 11419 | L4_MABX_B.RelationalOperator_l5 = (L4_MABX_B.DataTypeConversion5_e3 >= |
| 11420 | L4_MABX_P.Constant_Value_mg); |
| 11421 | |
| 11422 | /* Switch: '<S283>/Switch' incorporates: |
| 11423 | * Constant: '<S283>/Constant1' |
| 11424 | */ |
| 11425 | if (L4_MABX_B.RelationalOperator_l5) { |
| 11426 | L4_MABX_B.Switch_hq = L4_MABX_B.correctedError; |
| 11427 | } else { |
| 11428 | L4_MABX_B.Switch_hq = L4_MABX_P.Constant1_Value_l; |
| 11429 | } |
| 11430 | |
| 11431 | /* End of Switch: '<S283>/Switch' */ |
| 11432 | |
| 11433 | /* Outputs for Enabled SubSystem: '<S283>/Slew_at_event' incorporates: |
| 11434 | * EnablePort: '<S340>/Enable' |
| 11435 | */ |
| 11436 | /* Constant: '<S283>/enable' */ |
| 11437 | if (L4_MABX_P.enable_Value > 0.0) { |
| 11438 | if (!L4_MABX_DW.Slew_at_event_MODE_d) { |
| 11439 | /* InitializeConditions for UnitDelay: '<S342>/Unit_Delay' */ |
| 11440 | L4_MABX_DW.Unit_Delay_DSTATE_bd = L4_MABX_P.Unit_Delay_InitialCondition_ls; |
| 11441 | |
| 11442 | /* InitializeConditions for UnitDelay: '<S343>/Unit_Delay' */ |
| 11443 | L4_MABX_DW.Unit_Delay_DSTATE_jt = L4_MABX_P.Unit_Delay_InitialCondition_i0; |
| 11444 | |
| 11445 | /* InitializeConditions for UnitDelay: '<S346>/FixPt Unit Delay2' */ |
| 11446 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_j = |
| 11447 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_c; |
| 11448 | |
| 11449 | /* InitializeConditions for UnitDelay: '<S346>/FixPt Unit Delay1' */ |
| 11450 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_ov = |
| 11451 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_f; |
| 11452 | |
| 11453 | /* InitializeConditions for UnitDelay: '<S341>/Unit_Delay' */ |
| 11454 | L4_MABX_DW.Unit_Delay_DSTATE_ll = L4_MABX_P.Unit_Delay_InitialCondition_ld; |
| 11455 | L4_MABX_DW.Slew_at_event_MODE_d = true; |
| 11456 | } |
| 11457 | |
| 11458 | /* UnitDelay: '<S342>/Unit_Delay' */ |
| 11459 | L4_MABX_B.Unit_Delay_o3 = L4_MABX_DW.Unit_Delay_DSTATE_bd; |
| 11460 | |
| 11461 | /* Logic: '<S342>/Logical Operator1' */ |
| 11462 | L4_MABX_B.LogicalOperator1_gw = !L4_MABX_B.Unit_Delay_o3; |
| 11463 | |
| 11464 | /* Logic: '<S342>/Logical Operator' */ |
| 11465 | L4_MABX_B.LogicalOperator_d2 = (L4_MABX_B.DataTypeConversion_l1 && |
| 11466 | L4_MABX_B.LogicalOperator1_gw); |
| 11467 | |
| 11468 | /* UnitDelay: '<S343>/Unit_Delay' */ |
| 11469 | L4_MABX_B.Unit_Delay_hj = L4_MABX_DW.Unit_Delay_DSTATE_jt; |
| 11470 | |
| 11471 | /* Logic: '<S343>/Logical Operator1' */ |
| 11472 | L4_MABX_B.LogicalOperator1_h = (L4_MABX_B.LogicalOperator_d2 || |
| 11473 | L4_MABX_B.Unit_Delay_hj); |
| 11474 | |
| 11475 | /* UnitDelay: '<S346>/FixPt Unit Delay2' */ |
| 11476 | L4_MABX_B.FixPtUnitDelay2_h5 = L4_MABX_DW.FixPtUnitDelay2_DSTATE_j; |
| 11477 | |
| 11478 | /* UnitDelay: '<S346>/FixPt Unit Delay1' */ |
| 11479 | L4_MABX_B.Xold_g = L4_MABX_DW.FixPtUnitDelay1_DSTATE_ov; |
| 11480 | |
| 11481 | /* Switch: '<S346>/Init' */ |
| 11482 | if (L4_MABX_B.FixPtUnitDelay2_h5 != 0) { |
| 11483 | L4_MABX_B.Init_jw = L4_MABX_B.Switch_hq; |
| 11484 | } else { |
| 11485 | L4_MABX_B.Init_jw = L4_MABX_B.Xold_g; |
| 11486 | } |
| 11487 | |
| 11488 | /* End of Switch: '<S346>/Init' */ |
| 11489 | |
| 11490 | /* Abs: '<S343>/Abs' incorporates: |
| 11491 | * Constant: '<S283>/Constant3' |
| 11492 | */ |
| 11493 | L4_MABX_B.Abs_a = fabs(L4_MABX_P.Constant3_Value_j); |
| 11494 | |
| 11495 | /* Product: '<S343>/Product1' incorporates: |
| 11496 | * Constant: '<S283>/Constant2' |
| 11497 | */ |
| 11498 | L4_MABX_B.Product1_i3 = L4_MABX_B.Abs_a * L4_MABX_P.Constant2_Value_p; |
| 11499 | |
| 11500 | /* Sum: '<S343>/Add1' */ |
| 11501 | L4_MABX_B.Add1_b0 = L4_MABX_B.Init_jw + L4_MABX_B.Product1_i3; |
| 11502 | |
| 11503 | /* MinMax: '<S343>/MinMax2' */ |
| 11504 | DeltaTime = L4_MABX_B.Switch_hq; |
| 11505 | PositionFinalLimited = L4_MABX_B.Add1_b0; |
| 11506 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 11507 | PositionFinalLimited = DeltaTime; |
| 11508 | } |
| 11509 | |
| 11510 | L4_MABX_B.MinMax2_l = PositionFinalLimited; |
| 11511 | |
| 11512 | /* End of MinMax: '<S343>/MinMax2' */ |
| 11513 | |
| 11514 | /* Abs: '<S343>/Abs1' incorporates: |
| 11515 | * Constant: '<S283>/Constant4' |
| 11516 | */ |
| 11517 | L4_MABX_B.Abs1_e = fabs(L4_MABX_P.Constant4_Value_bq); |
| 11518 | |
| 11519 | /* Product: '<S343>/Product2' incorporates: |
| 11520 | * Constant: '<S283>/Constant2' |
| 11521 | */ |
| 11522 | L4_MABX_B.Product2_k = L4_MABX_P.Constant2_Value_p * L4_MABX_B.Abs1_e; |
| 11523 | |
| 11524 | /* Sum: '<S343>/Subtract1' */ |
| 11525 | L4_MABX_B.Subtract1_g = L4_MABX_B.Init_jw - L4_MABX_B.Product2_k; |
| 11526 | |
| 11527 | /* MinMax: '<S343>/MinMax1' */ |
| 11528 | DeltaTime = L4_MABX_B.MinMax2_l; |
| 11529 | PositionFinalLimited = L4_MABX_B.Subtract1_g; |
| 11530 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 11531 | PositionFinalLimited = DeltaTime; |
| 11532 | } |
| 11533 | |
| 11534 | L4_MABX_B.MinMax1_k = PositionFinalLimited; |
| 11535 | |
| 11536 | /* End of MinMax: '<S343>/MinMax1' */ |
| 11537 | |
| 11538 | /* Outputs for Atomic SubSystem: '<S343>/If_Then_Else' */ |
| 11539 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_h, L4_MABX_B.Switch_hq, |
| 11540 | L4_MABX_B.MinMax1_k, &L4_MABX_B.If_Then_Else_n3); |
| 11541 | |
| 11542 | /* End of Outputs for SubSystem: '<S343>/If_Then_Else' */ |
| 11543 | |
| 11544 | /* Sum: '<S340>/Subtract' */ |
| 11545 | L4_MABX_B.Subtract_ij = L4_MABX_B.Switch_hq - |
| 11546 | L4_MABX_B.If_Then_Else_n3.Switch; |
| 11547 | |
| 11548 | /* Abs: '<S340>/Abs' */ |
| 11549 | L4_MABX_B.Abs_eu = fabs(L4_MABX_B.Subtract_ij); |
| 11550 | |
| 11551 | /* RelationalOperator: '<S340>/Relational Operator1' incorporates: |
| 11552 | * Constant: '<S340>/Constant1' |
| 11553 | */ |
| 11554 | L4_MABX_B.RelationalOperator1_e = (L4_MABX_B.Abs_eu <= |
| 11555 | L4_MABX_P.Constant1_Value_ah); |
| 11556 | |
| 11557 | /* Logic: '<S341>/Logical Operator3' */ |
| 11558 | L4_MABX_B.LogicalOperator3_a = !L4_MABX_B.RelationalOperator1_e; |
| 11559 | |
| 11560 | /* UnitDelay: '<S341>/Unit_Delay' */ |
| 11561 | L4_MABX_B.Unit_Delay_ig = L4_MABX_DW.Unit_Delay_DSTATE_ll; |
| 11562 | |
| 11563 | /* Logic: '<S341>/Logical Operator1' */ |
| 11564 | L4_MABX_B.LogicalOperator1_jo = (L4_MABX_B.DataTypeConversion_l1 || |
| 11565 | L4_MABX_B.Unit_Delay_ig); |
| 11566 | |
| 11567 | /* Logic: '<S341>/Logical Operator' */ |
| 11568 | L4_MABX_B.LogicalOperator_dm = (L4_MABX_B.LogicalOperator3_a && |
| 11569 | L4_MABX_B.LogicalOperator1_jo); |
| 11570 | |
| 11571 | /* Logic: '<S341>/Logical Operator2' */ |
| 11572 | L4_MABX_B.LogicalOperator2_jq = !L4_MABX_B.LogicalOperator_dm; |
| 11573 | |
| 11574 | /* RelationalOperator: '<S344>/min_relop' incorporates: |
| 11575 | * Constant: '<S283>/Constant3' |
| 11576 | * Constant: '<S344>/min_val' |
| 11577 | */ |
| 11578 | L4_MABX_B.min_relop_d = (L4_MABX_P.CheckStaticLowerBound_min_n <= |
| 11579 | L4_MABX_P.Constant3_Value_j); |
| 11580 | |
| 11581 | /* Assertion: '<S344>/Assertion' */ |
| 11582 | utAssert(L4_MABX_B.min_relop_d); |
| 11583 | } else { |
| 11584 | if (L4_MABX_DW.Slew_at_event_MODE_d) { |
| 11585 | /* Disable for Outport: '<S340>/F_Out_slewing' */ |
| 11586 | L4_MABX_B.LogicalOperator_dm = L4_MABX_P.F_Out_slewing_Y0; |
| 11587 | |
| 11588 | /* Disable for Outport: '<S340>/Out' */ |
| 11589 | L4_MABX_B.If_Then_Else_n3.Switch = L4_MABX_P.Out_Y0; |
| 11590 | L4_MABX_DW.Slew_at_event_MODE_d = false; |
| 11591 | } |
| 11592 | } |
| 11593 | |
| 11594 | /* End of Constant: '<S283>/enable' */ |
| 11595 | /* End of Outputs for SubSystem: '<S283>/Slew_at_event' */ |
| 11596 | |
| 11597 | /* Switch: '<S283>/Switch1' incorporates: |
| 11598 | * Constant: '<S283>/enableSlew' |
| 11599 | */ |
| 11600 | if (L4_MABX_P.enableSlew_Value != 0.0) { |
| 11601 | L4_MABX_B.Switch1_j = L4_MABX_B.If_Then_Else_n3.Switch; |
| 11602 | } else { |
| 11603 | L4_MABX_B.Switch1_j = L4_MABX_B.Switch_hq; |
| 11604 | } |
| 11605 | |
| 11606 | /* End of Switch: '<S283>/Switch1' */ |
| 11607 | |
| 11608 | /* Gain: '<S80>/sign' */ |
| 11609 | L4_MABX_B.SteerCtrlErrRaw = L4_MABX_P.sign_Gain * L4_MABX_B.Switch1_j; |
| 11610 | |
| 11611 | /* DataTypeConversion: '<S80>/Data Type Conversion1' */ |
| 11612 | L4_MABX_B.DataTypeConversion1_ev = L4_MABX_B.SteerCtrlErrRaw; |
| 11613 | |
| 11614 | /* UnitDelay: '<S285>/Unit Delay' */ |
| 11615 | L4_MABX_B.UnitDelay_fm = L4_MABX_DW.UnitDelay_DSTATE_d; |
| 11616 | |
| 11617 | /* Switch: '<S289>/Switch1' incorporates: |
| 11618 | * Constant: '<S285>/E' |
| 11619 | * Constant: '<S285>/R' |
| 11620 | * Switch: '<S287>/Switch1' |
| 11621 | */ |
| 11622 | if (L4_MABX_P.R_Value) { |
| 11623 | /* DataTypeConversion: '<S285>/Data Type Conversion1' incorporates: |
| 11624 | * Constant: '<S285>/IV' |
| 11625 | */ |
| 11626 | L4_MABX_B.DataTypeConversion1_b1 = (real32_T)L4_MABX_P.IV_Value; |
| 11627 | L4_MABX_B.Switch1_fi = L4_MABX_B.DataTypeConversion1_b1; |
| 11628 | } else { |
| 11629 | if (L4_MABX_P.E_Value_j) { |
| 11630 | /* DataTypeConversion: '<S285>/Data Type Conversion' incorporates: |
| 11631 | * Switch: '<S287>/Switch1' |
| 11632 | */ |
| 11633 | L4_MABX_B.DataTypeConversion_ps = (real32_T) |
| 11634 | L4_MABX_B.DataTypeConversion1_ev; |
| 11635 | |
| 11636 | /* Sum: '<S285>/Add3' incorporates: |
| 11637 | * Switch: '<S287>/Switch1' |
| 11638 | */ |
| 11639 | L4_MABX_B.Add3_j = L4_MABX_B.DataTypeConversion_ps - |
| 11640 | L4_MABX_B.UnitDelay_fm; |
| 11641 | |
| 11642 | /* Product: '<S285>/Product1' incorporates: |
| 11643 | * Switch: '<S287>/Switch1' |
| 11644 | */ |
| 11645 | L4_MABX_B.Product1_n2 = L4_MABX_B.Divide_nn * L4_MABX_B.Add3_j; |
| 11646 | |
| 11647 | /* Sum: '<S285>/Add' incorporates: |
| 11648 | * Switch: '<S287>/Switch1' |
| 11649 | */ |
| 11650 | L4_MABX_B.Add_f = L4_MABX_B.Product1_n2 + L4_MABX_B.UnitDelay_fm; |
| 11651 | |
| 11652 | /* Switch: '<S287>/Switch1' */ |
| 11653 | L4_MABX_B.Switch1_cw = L4_MABX_B.Add_f; |
| 11654 | } else { |
| 11655 | /* Switch: '<S287>/Switch1' */ |
| 11656 | L4_MABX_B.Switch1_cw = L4_MABX_B.UnitDelay_fm; |
| 11657 | } |
| 11658 | |
| 11659 | L4_MABX_B.Switch1_fi = L4_MABX_B.Switch1_cw; |
| 11660 | } |
| 11661 | |
| 11662 | /* End of Switch: '<S289>/Switch1' */ |
| 11663 | |
| 11664 | /* DataTypeConversion: '<S286>/Conversion' */ |
| 11665 | L4_MABX_B.Conversion = L4_MABX_B.Switch1_fi; |
| 11666 | |
| 11667 | /* Abs: '<S80>/Abs' */ |
| 11668 | L4_MABX_B.Abs_d = fabs(L4_MABX_B.Conversion); |
| 11669 | |
| 11670 | /* Lookup_n-D: '<S80>/SteeringControlPGainErrorBased' */ |
| 11671 | L4_MABX_B.SteeringControlPGainErrorBased = look1_binlxpw(L4_MABX_B.Abs_d, |
| 11672 | L4_MABX_P.SteeringControlPGainErrorBase_n, |
| 11673 | L4_MABX_P.SteeringControlPGainErrorBased_, 9U); |
| 11674 | |
| 11675 | /* DataTypeConversion: '<S80>/Data Type Conversion' */ |
| 11676 | L4_MABX_B.DataTypeConversion_k = L4_MABX_B.SFunction1_o1_gd; |
| 11677 | |
| 11678 | /* Lookup_n-D: '<S80>/SteeringControlPGainSpeedFactor' */ |
| 11679 | L4_MABX_B.SteeringControlPGainSpeedFactor = look1_binlxpw |
| 11680 | (L4_MABX_B.DataTypeConversion_k, L4_MABX_P.SteeringControlPGainSpeedFact_i, |
| 11681 | L4_MABX_P.SteeringControlPGainSpeedFactor, 8U); |
| 11682 | |
| 11683 | /* Product: '<S80>/Product1' */ |
| 11684 | L4_MABX_B.SteerCtrlPgain = L4_MABX_B.SteeringControlPGainErrorBased * |
| 11685 | L4_MABX_B.SteeringControlPGainSpeedFactor; |
| 11686 | |
| 11687 | /* Gain: '<S80>/Gain' */ |
| 11688 | L4_MABX_B.Gain_c = L4_MABX_P.Gain_Gain_m * L4_MABX_B.SteerCtrlPgain; |
| 11689 | |
| 11690 | /* Product: '<S296>/Product' */ |
| 11691 | L4_MABX_B.Product_d = L4_MABX_B.Conversion * L4_MABX_B.Gain_c; |
| 11692 | |
| 11693 | /* Product: '<S296>/Divide' incorporates: |
| 11694 | * Constant: '<S279>/Constant21' |
| 11695 | * Constant: '<S279>/SteeringControlIntGain' |
| 11696 | */ |
| 11697 | L4_MABX_B.Divide_ag = L4_MABX_P.Constant21_Value / |
| 11698 | L4_MABX_P.SteeringControlIntGain_Value; |
| 11699 | |
| 11700 | /* Product: '<S296>/Product1' */ |
| 11701 | L4_MABX_B.Product1_hr = L4_MABX_B.Product_d * L4_MABX_B.Divide_ag; |
| 11702 | |
| 11703 | /* UnitDelay: '<S295>/Unit Delay' */ |
| 11704 | L4_MABX_B.UnitDelay_m5 = L4_MABX_DW.UnitDelay_DSTATE_m; |
| 11705 | |
| 11706 | /* RelationalOperator: '<S295>/Relational Operator' incorporates: |
| 11707 | * Constant: '<S279>/Constant19' |
| 11708 | */ |
| 11709 | L4_MABX_B.RelationalOperator_dl = (L4_MABX_B.UnitDelay_m5 >= |
| 11710 | L4_MABX_P.Constant19_Value); |
| 11711 | |
| 11712 | /* Switch: '<S295>/Switch' incorporates: |
| 11713 | * Constant: '<S295>/Constant3' |
| 11714 | */ |
| 11715 | if (L4_MABX_B.RelationalOperator_dl) { |
| 11716 | L4_MABX_B.Switch_o = L4_MABX_P.Constant3_Value_pw; |
| 11717 | } else { |
| 11718 | /* RelationalOperator: '<S295>/Relational Operator1' incorporates: |
| 11719 | * Constant: '<S279>/Constant20' |
| 11720 | */ |
| 11721 | L4_MABX_B.RelationalOperator1_m = (L4_MABX_B.UnitDelay_m5 <= |
| 11722 | L4_MABX_P.Constant20_Value); |
| 11723 | |
| 11724 | /* Switch: '<S295>/Switch1' incorporates: |
| 11725 | * Constant: '<S295>/Constant' |
| 11726 | * Constant: '<S295>/Constant2' |
| 11727 | */ |
| 11728 | if (L4_MABX_B.RelationalOperator1_m) { |
| 11729 | L4_MABX_B.Switch1_m = L4_MABX_P.Constant2_Value_hu; |
| 11730 | } else { |
| 11731 | L4_MABX_B.Switch1_m = L4_MABX_P.Constant_Value_i; |
| 11732 | } |
| 11733 | |
| 11734 | /* End of Switch: '<S295>/Switch1' */ |
| 11735 | L4_MABX_B.Switch_o = L4_MABX_B.Switch1_m; |
| 11736 | } |
| 11737 | |
| 11738 | /* End of Switch: '<S295>/Switch' */ |
| 11739 | |
| 11740 | /* RelationalOperator: '<S298>/Relational Operator5' incorporates: |
| 11741 | * Constant: '<S298>/Constant5' |
| 11742 | */ |
| 11743 | L4_MABX_B.RelationalOperator5_f = (L4_MABX_B.Switch_o != |
| 11744 | L4_MABX_P.Constant5_Value_o); |
| 11745 | |
| 11746 | /* Signum: '<S298>/Sign1' */ |
| 11747 | PositionFinalLimited = L4_MABX_B.Product1_hr; |
| 11748 | if (PositionFinalLimited < 0.0) { |
| 11749 | L4_MABX_B.Sign1 = -1.0; |
| 11750 | } else if (PositionFinalLimited > 0.0) { |
| 11751 | L4_MABX_B.Sign1 = 1.0; |
| 11752 | } else if (PositionFinalLimited == 0.0) { |
| 11753 | L4_MABX_B.Sign1 = 0.0; |
| 11754 | } else { |
| 11755 | L4_MABX_B.Sign1 = (rtNaN); |
| 11756 | } |
| 11757 | |
| 11758 | /* End of Signum: '<S298>/Sign1' */ |
| 11759 | |
| 11760 | /* RelationalOperator: '<S298>/Relational Operator4' incorporates: |
| 11761 | * Constant: '<S298>/Constant4' |
| 11762 | */ |
| 11763 | L4_MABX_B.RelationalOperator4_la = (L4_MABX_P.Constant4_Value_j == |
| 11764 | L4_MABX_B.Sign1); |
| 11765 | |
| 11766 | /* RelationalOperator: '<S298>/Relational Operator2' incorporates: |
| 11767 | * Constant: '<S298>/Constant2' |
| 11768 | */ |
| 11769 | L4_MABX_B.RelationalOperator2_o = (L4_MABX_B.Switch_o != |
| 11770 | L4_MABX_P.Constant2_Value_g); |
| 11771 | |
| 11772 | /* Logic: '<S298>/Logical Operator1' */ |
| 11773 | L4_MABX_B.LogicalOperator1_ji = (L4_MABX_B.RelationalOperator4_la && |
| 11774 | L4_MABX_B.RelationalOperator2_o); |
| 11775 | |
| 11776 | /* RelationalOperator: '<S298>/Relational Operator1' incorporates: |
| 11777 | * Constant: '<S298>/Constant1' |
| 11778 | */ |
| 11779 | L4_MABX_B.RelationalOperator1_ie = (L4_MABX_B.Switch_o != |
| 11780 | L4_MABX_P.Constant1_Value_ly); |
| 11781 | |
| 11782 | /* RelationalOperator: '<S298>/Relational Operator3' incorporates: |
| 11783 | * Constant: '<S298>/Constant3' |
| 11784 | */ |
| 11785 | L4_MABX_B.RelationalOperator3_p = (L4_MABX_P.Constant3_Value_g == |
| 11786 | L4_MABX_B.Sign1); |
| 11787 | |
| 11788 | /* Logic: '<S298>/Logical Operator2' */ |
| 11789 | L4_MABX_B.LogicalOperator2_o = (L4_MABX_B.RelationalOperator1_ie && |
| 11790 | L4_MABX_B.RelationalOperator3_p); |
| 11791 | |
| 11792 | /* Logic: '<S298>/Logical Operator' */ |
| 11793 | L4_MABX_B.LogicalOperator_bs = (L4_MABX_B.LogicalOperator1_ji || |
| 11794 | L4_MABX_B.LogicalOperator2_o); |
| 11795 | |
| 11796 | /* Logic: '<S298>/Logical Operator3' */ |
| 11797 | L4_MABX_B.LogicalOperator3_oi = (L4_MABX_B.RelationalOperator5_f && |
| 11798 | L4_MABX_B.LogicalOperator_bs); |
| 11799 | |
| 11800 | /* Switch: '<S298>/Switch1' incorporates: |
| 11801 | * Constant: '<S298>/Constant' |
| 11802 | */ |
| 11803 | if (L4_MABX_B.LogicalOperator3_oi) { |
| 11804 | L4_MABX_B.Switch1_jw = L4_MABX_B.Product1_hr; |
| 11805 | } else { |
| 11806 | L4_MABX_B.Switch1_jw = L4_MABX_P.Constant_Value_o; |
| 11807 | } |
| 11808 | |
| 11809 | /* End of Switch: '<S298>/Switch1' */ |
| 11810 | |
| 11811 | /* UnitDelay: '<S296>/Unit Delay' */ |
| 11812 | L4_MABX_B.UnitDelay_o = L4_MABX_DW.UnitDelay_DSTATE_m0; |
| 11813 | |
| 11814 | /* Sum: '<S296>/Add' */ |
| 11815 | L4_MABX_B.Add_px = L4_MABX_B.Switch1_jw + L4_MABX_B.UnitDelay_o; |
| 11816 | |
| 11817 | /* Product: '<S296>/Divide1' incorporates: |
| 11818 | * Constant: '<S279>/Constant21' |
| 11819 | * Constant: '<S279>/SteeringControlDGain' |
| 11820 | */ |
| 11821 | L4_MABX_B.Divide1_b = L4_MABX_P.SteeringControlDGain_Value * |
| 11822 | L4_MABX_B.Product_d / L4_MABX_P.Constant21_Value; |
| 11823 | |
| 11824 | /* UnitDelay: '<S296>/Unit Delay1' */ |
| 11825 | L4_MABX_B.UnitDelay1_e = L4_MABX_DW.UnitDelay1_DSTATE_k; |
| 11826 | |
| 11827 | /* Sum: '<S296>/Add3' */ |
| 11828 | L4_MABX_B.Add3 = L4_MABX_B.Divide1_b - L4_MABX_B.UnitDelay1_e; |
| 11829 | |
| 11830 | /* Sum: '<S296>/Add1' */ |
| 11831 | L4_MABX_B.Add1_m = (L4_MABX_B.Product_d + L4_MABX_B.Add_px) + L4_MABX_B.Add3; |
| 11832 | |
| 11833 | /* RelationalOperator: '<S297>/LowerRelop1' incorporates: |
| 11834 | * Constant: '<S279>/Constant19' |
| 11835 | */ |
| 11836 | L4_MABX_B.LowerRelop1 = (L4_MABX_B.Add1_m > L4_MABX_P.Constant19_Value); |
| 11837 | |
| 11838 | /* RelationalOperator: '<S297>/UpperRelop' incorporates: |
| 11839 | * Constant: '<S279>/Constant20' |
| 11840 | */ |
| 11841 | L4_MABX_B.UpperRelop = (L4_MABX_B.Add1_m < L4_MABX_P.Constant20_Value); |
| 11842 | |
| 11843 | /* Switch: '<S297>/Switch' incorporates: |
| 11844 | * Constant: '<S279>/Constant20' |
| 11845 | */ |
| 11846 | if (L4_MABX_B.UpperRelop) { |
| 11847 | L4_MABX_B.Switch_p = L4_MABX_P.Constant20_Value; |
| 11848 | } else { |
| 11849 | L4_MABX_B.Switch_p = L4_MABX_B.Add1_m; |
| 11850 | } |
| 11851 | |
| 11852 | /* End of Switch: '<S297>/Switch' */ |
| 11853 | |
| 11854 | /* Switch: '<S297>/Switch2' incorporates: |
| 11855 | * Constant: '<S279>/Constant19' |
| 11856 | */ |
| 11857 | if (L4_MABX_B.LowerRelop1) { |
| 11858 | L4_MABX_B.Switch2_i = L4_MABX_P.Constant19_Value; |
| 11859 | } else { |
| 11860 | L4_MABX_B.Switch2_i = L4_MABX_B.Switch_p; |
| 11861 | } |
| 11862 | |
| 11863 | /* End of Switch: '<S297>/Switch2' */ |
| 11864 | |
| 11865 | /* RateTransition: '<S80>/TmpRTBAtrad2deg1Inport1' */ |
| 11866 | if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) { |
| 11867 | L4_MABX_B.previewSteeringAngle_b = |
| 11868 | L4_MABX_DW.TmpRTBAtrad2deg1Inport1_Buffer0; |
| 11869 | } |
| 11870 | |
| 11871 | /* Gain: '<S80>/rad2deg1' */ |
| 11872 | L4_MABX_B.rad2deg1 = L4_MABX_P.rad2deg1_Gain * |
| 11873 | L4_MABX_B.previewSteeringAngle_b; |
| 11874 | |
| 11875 | /* Sum: '<S80>/Add2' incorporates: |
| 11876 | * Constant: '<S80>/steeringOffset' |
| 11877 | */ |
| 11878 | L4_MABX_B.Add2 = (L4_MABX_B.rad2deg1 + L4_MABX_B.Switch2_i) + |
| 11879 | L4_MABX_P.steeringOffset_Value; |
| 11880 | |
| 11881 | /* Lookup_n-D: '<S284>/1-D Lookup Table' */ |
| 11882 | L4_MABX_B.uDLookupTable_a = look1_binlxpw(L4_MABX_B.DataTypeConversion_k, |
| 11883 | L4_MABX_P.uDLookupTable_bp01Data_k, L4_MABX_P.uDLookupTable_tableData_b, 8U); |
| 11884 | |
| 11885 | /* Product: '<S284>/AdjustedStanleyGain' incorporates: |
| 11886 | * Constant: '<S284>/stanleySteeringControlGain' |
| 11887 | */ |
| 11888 | L4_MABX_B.AdjustedStanleyGain = L4_MABX_B.uDLookupTable_a * |
| 11889 | L4_MABX_P.stanleySteeringControlGain_Valu; |
| 11890 | |
| 11891 | /* Step: '<S278>/Step' */ |
| 11892 | PositionFinalLimited = L4_MABX_M->Timing.t[0]; |
| 11893 | if (PositionFinalLimited < L4_MABX_P.Step_Time) { |
| 11894 | L4_MABX_B.Step = L4_MABX_P.Step_Y0; |
| 11895 | } else { |
| 11896 | L4_MABX_B.Step = L4_MABX_P.Step_YFinal; |
| 11897 | } |
| 11898 | |
| 11899 | /* End of Step: '<S278>/Step' */ |
| 11900 | |
| 11901 | /* DataTypeConversion: '<S278>/Data Type Conversion' */ |
| 11902 | L4_MABX_B.DataTypeConversion_dn = (L4_MABX_B.Step != 0.0); |
| 11903 | |
| 11904 | /* Product: '<S290>/Divide' incorporates: |
| 11905 | * Constant: '<S278>/Constant' |
| 11906 | * Constant: '<S278>/Constant1' |
| 11907 | */ |
| 11908 | L4_MABX_B.Divide_d0 = (real32_T)(L4_MABX_P.Constant1_Value_iy / |
| 11909 | L4_MABX_P.Constant_Value_d); |
| 11910 | |
| 11911 | /* RateTransition: '<S80>/TmpRTBAtsignCurveOffsetInport1' */ |
| 11912 | if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) { |
| 11913 | L4_MABX_B.TmpRTBAtsignCurveOffsetInport1 = |
| 11914 | L4_MABX_DW.TmpRTBAtsignCurveOffsetInport1_; |
| 11915 | } |
| 11916 | |
| 11917 | /* Gain: '<S80>/signCurveOffset' */ |
| 11918 | L4_MABX_B.signCurveOffset = L4_MABX_P.signCurveOffset_Gain * |
| 11919 | L4_MABX_B.TmpRTBAtsignCurveOffsetInport1; |
| 11920 | |
| 11921 | /* UnitDelay: '<S290>/Unit Delay' */ |
| 11922 | L4_MABX_B.UnitDelay_lj = L4_MABX_DW.UnitDelay_DSTATE_m1; |
| 11923 | |
| 11924 | /* Switch: '<S294>/Switch1' incorporates: |
| 11925 | * Constant: '<S290>/E' |
| 11926 | * Switch: '<S292>/Switch1' |
| 11927 | */ |
| 11928 | if (L4_MABX_B.DataTypeConversion_dn) { |
| 11929 | /* DataTypeConversion: '<S290>/Data Type Conversion1' incorporates: |
| 11930 | * Constant: '<S290>/IV' |
| 11931 | */ |
| 11932 | L4_MABX_B.DataTypeConversion1_g = (real32_T)L4_MABX_P.IV_Value_o; |
| 11933 | L4_MABX_B.Switch1_pb = L4_MABX_B.DataTypeConversion1_g; |
| 11934 | } else { |
| 11935 | if (L4_MABX_P.E_Value_ct) { |
| 11936 | /* DataTypeConversion: '<S290>/Data Type Conversion' incorporates: |
| 11937 | * Switch: '<S292>/Switch1' |
| 11938 | */ |
| 11939 | L4_MABX_B.DataTypeConversion_m = (real32_T)L4_MABX_B.signCurveOffset; |
| 11940 | |
| 11941 | /* Sum: '<S290>/Add3' incorporates: |
| 11942 | * Switch: '<S292>/Switch1' |
| 11943 | */ |
| 11944 | L4_MABX_B.Add3_p = L4_MABX_B.DataTypeConversion_m - L4_MABX_B.UnitDelay_lj; |
| 11945 | |
| 11946 | /* Product: '<S290>/Product1' incorporates: |
| 11947 | * Switch: '<S292>/Switch1' |
| 11948 | */ |
| 11949 | L4_MABX_B.Product1_ce = L4_MABX_B.Divide_d0 * L4_MABX_B.Add3_p; |
| 11950 | |
| 11951 | /* Sum: '<S290>/Add' incorporates: |
| 11952 | * Switch: '<S292>/Switch1' |
| 11953 | */ |
| 11954 | L4_MABX_B.Add_a = L4_MABX_B.Product1_ce + L4_MABX_B.UnitDelay_lj; |
| 11955 | |
| 11956 | /* Switch: '<S292>/Switch1' */ |
| 11957 | L4_MABX_B.Switch1_aq = L4_MABX_B.Add_a; |
| 11958 | } else { |
| 11959 | /* Switch: '<S292>/Switch1' */ |
| 11960 | L4_MABX_B.Switch1_aq = L4_MABX_B.UnitDelay_lj; |
| 11961 | } |
| 11962 | |
| 11963 | L4_MABX_B.Switch1_pb = L4_MABX_B.Switch1_aq; |
| 11964 | } |
| 11965 | |
| 11966 | /* End of Switch: '<S294>/Switch1' */ |
| 11967 | |
| 11968 | /* DataTypeConversion: '<S291>/Conversion' */ |
| 11969 | L4_MABX_B.Conversion_b = L4_MABX_B.Switch1_pb; |
| 11970 | |
| 11971 | /* Gain: '<S80>/mm2m' */ |
| 11972 | L4_MABX_B.mm2m = L4_MABX_P.mm2m_Gain * L4_MABX_B.correctedError; |
| 11973 | |
| 11974 | /* Switch: '<S80>/Switch3' incorporates: |
| 11975 | * Constant: '<S80>/usePIDyForStanley' |
| 11976 | */ |
| 11977 | if (L4_MABX_P.usePIDyForStanley_Value != 0.0) { |
| 11978 | L4_MABX_B.Switch3 = L4_MABX_B.Switch2_i; |
| 11979 | } else { |
| 11980 | L4_MABX_B.Switch3 = L4_MABX_B.mm2m; |
| 11981 | } |
| 11982 | |
| 11983 | /* End of Switch: '<S80>/Switch3' */ |
| 11984 | |
| 11985 | /* Gain: '<S80>/sign3' */ |
| 11986 | L4_MABX_B.sign3 = L4_MABX_P.sign3_Gain * L4_MABX_B.Switch3; |
| 11987 | |
| 11988 | /* Sum: '<S80>/crossTrackError' */ |
| 11989 | L4_MABX_B.crossTrackError = L4_MABX_B.Conversion_b + L4_MABX_B.sign3; |
| 11990 | |
| 11991 | /* Product: '<S284>/Product' */ |
| 11992 | L4_MABX_B.Product_p = L4_MABX_B.AdjustedStanleyGain * |
| 11993 | L4_MABX_B.crossTrackError; |
| 11994 | |
| 11995 | /* Saturate: '<S284>/Saturation' */ |
| 11996 | DeltaTime = L4_MABX_B.DataTypeConversion_k; |
| 11997 | Time56 = L4_MABX_P.Saturation_LowerSat_bq; |
| 11998 | AccelerationAverage = L4_MABX_P.Saturation_UpperSat_e; |
| 11999 | if (DeltaTime > AccelerationAverage) { |
| 12000 | L4_MABX_B.Saturation_a = AccelerationAverage; |
| 12001 | } else if (DeltaTime < Time56) { |
| 12002 | L4_MABX_B.Saturation_a = Time56; |
| 12003 | } else { |
| 12004 | L4_MABX_B.Saturation_a = DeltaTime; |
| 12005 | } |
| 12006 | |
| 12007 | /* End of Saturate: '<S284>/Saturation' */ |
| 12008 | |
| 12009 | /* Gain: '<S284>/kph2mps_' */ |
| 12010 | L4_MABX_B.kph2mps_ = L4_MABX_P.kph2mps_Gain * L4_MABX_B.Saturation_a; |
| 12011 | |
| 12012 | /* Trigonometry: '<S284>/Trigonometric Function' */ |
| 12013 | L4_MABX_B.TrigonometricFunction_p = rt_atan2d_snf(L4_MABX_B.Product_p, |
| 12014 | L4_MABX_B.kph2mps_); |
| 12015 | |
| 12016 | /* Gain: '<S80>/deg2rad1' */ |
| 12017 | L4_MABX_B.deg2rad1 = L4_MABX_P.deg2rad1_Gain * L4_MABX_B.uDLookupTable1; |
| 12018 | |
| 12019 | /* RateTransition: '<S284>/TmpRTBAtAdd2Inport2' */ |
| 12020 | if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) { |
| 12021 | L4_MABX_B.TmpRTBAtAdd2Inport2 = L4_MABX_DW.TmpRTBAtAdd2Inport2_Buffer0; |
| 12022 | } |
| 12023 | |
| 12024 | /* Sum: '<S284>/Add2' */ |
| 12025 | L4_MABX_B.Add2_g = L4_MABX_B.deg2rad1 - L4_MABX_B.TmpRTBAtAdd2Inport2; |
| 12026 | |
| 12027 | /* Gain: '<S284>/desHeadingWeight' */ |
| 12028 | L4_MABX_B.desHeadingWeight = L4_MABX_P.desHeadingWeight_Gain * |
| 12029 | L4_MABX_B.Add2_g; |
| 12030 | |
| 12031 | /* Sum: '<S284>/Add1' */ |
| 12032 | L4_MABX_B.Add1_hl = L4_MABX_B.TrigonometricFunction_p + |
| 12033 | L4_MABX_B.desHeadingWeight; |
| 12034 | |
| 12035 | /* DataTypeConversion: '<S316>/Data Type Conversion' incorporates: |
| 12036 | * Constant: '<S316>/RATE_LIMITER_ENABLE_APV' |
| 12037 | */ |
| 12038 | L4_MABX_B.DataTypeConversion_l5 = (real_T)RATE_LIMITER_ENABLE_APV; |
| 12039 | |
| 12040 | /* Lookup_n-D: '<S316>/Saturation Speed Lookup' */ |
| 12041 | L4_MABX_B.SaturationSpeedLookup = look1_binlcapw |
| 12042 | (L4_MABX_B.DataTypeConversion_k, L4_MABX_P.SaturationSpeedLookup_bp01Data, |
| 12043 | L4_MABX_P.SaturationSpeedLookup_tableData, 5U); |
| 12044 | |
| 12045 | /* Constant: '<S316>/Constant' */ |
| 12046 | Lateral_Control_Rate_Limit = Lateral_Control_Rate_Limit_APV; |
| 12047 | |
| 12048 | /* SampleTimeMath: '<S327>/sample time' |
| 12049 | * |
| 12050 | * About '<S327>/sample time': |
| 12051 | * y = K where K = ( w * Ts ) |
| 12052 | */ |
| 12053 | L4_MABX_B.sampletime = L4_MABX_P.sampletime_WtEt; |
| 12054 | |
| 12055 | /* Product: '<S327>/delta rise limit' */ |
| 12056 | L4_MABX_B.deltariselimit = Lateral_Control_Rate_Limit * L4_MABX_B.sampletime; |
| 12057 | |
| 12058 | /* SampleTimeMath: '<S314>/sample time' |
| 12059 | * |
| 12060 | * About '<S314>/sample time': |
| 12061 | * y = K where K = ( w * Ts ) |
| 12062 | */ |
| 12063 | L4_MABX_B.sampletime_c = L4_MABX_P.sampletime_WtEt_j; |
| 12064 | |
| 12065 | /* Product: '<S314>/delta rise limit' incorporates: |
| 12066 | * Constant: '<S281>/Constant7' |
| 12067 | */ |
| 12068 | L4_MABX_B.deltariselimit_c = Lateral_Control_Error_Rate_Limit * |
| 12069 | L4_MABX_B.sampletime_c; |
| 12070 | |
| 12071 | /* MATLAB Function: '<S281>/Error Calc' */ |
| 12072 | /* MATLAB Function 'STEERCTRL_10ms/SteerController/Error Calc': '<S309>:1' */ |
| 12073 | /* '<S309>:1:3' */ |
| 12074 | Lateral_Control_Heading_Error = TargetAzimuth_rad - CurrentAzimuth_rad; |
| 12075 | if (Lateral_Control_Heading_Error < -3.1415926535897931) { |
| 12076 | /* '<S309>:1:5' */ |
| 12077 | /* '<S309>:1:6' */ |
| 12078 | Lateral_Control_Heading_Error += 6.2831853071795862; |
| 12079 | } else { |
| 12080 | if (Lateral_Control_Heading_Error > 3.1415926535897931) { |
| 12081 | /* '<S309>:1:7' */ |
| 12082 | /* '<S309>:1:8' */ |
| 12083 | Lateral_Control_Heading_Error -= 6.2831853071795862; |
| 12084 | } |
| 12085 | } |
| 12086 | |
| 12087 | /* End of MATLAB Function: '<S281>/Error Calc' */ |
| 12088 | |
| 12089 | /* UnitDelay: '<S314>/Delay Input2' */ |
| 12090 | L4_MABX_B.Yk1 = L4_MABX_DW.DelayInput2_DSTATE; |
| 12091 | |
| 12092 | /* Sum: '<S314>/Difference Inputs1' */ |
| 12093 | L4_MABX_B.UkYk1 = Lateral_Control_Heading_Error - L4_MABX_B.Yk1; |
| 12094 | |
| 12095 | /* RelationalOperator: '<S323>/LowerRelop1' */ |
| 12096 | L4_MABX_B.LowerRelop1_h = (L4_MABX_B.UkYk1 > L4_MABX_B.deltariselimit_c); |
| 12097 | |
| 12098 | /* Product: '<S314>/delta fall limit' incorporates: |
| 12099 | * Constant: '<S281>/Constant8' |
| 12100 | */ |
| 12101 | PositionFinalLimited = -Lateral_Control_Error_Rate_Limit; |
| 12102 | L4_MABX_B.deltafalllimit = PositionFinalLimited * L4_MABX_B.sampletime_c; |
| 12103 | |
| 12104 | /* RelationalOperator: '<S323>/UpperRelop' */ |
| 12105 | L4_MABX_B.UpperRelop_f = (L4_MABX_B.UkYk1 < L4_MABX_B.deltafalllimit); |
| 12106 | |
| 12107 | /* Switch: '<S323>/Switch' */ |
| 12108 | if (L4_MABX_B.UpperRelop_f) { |
| 12109 | L4_MABX_B.Switch_iv = L4_MABX_B.deltafalllimit; |
| 12110 | } else { |
| 12111 | L4_MABX_B.Switch_iv = L4_MABX_B.UkYk1; |
| 12112 | } |
| 12113 | |
| 12114 | /* End of Switch: '<S323>/Switch' */ |
| 12115 | |
| 12116 | /* Switch: '<S323>/Switch2' */ |
| 12117 | if (L4_MABX_B.LowerRelop1_h) { |
| 12118 | L4_MABX_B.Switch2_f = L4_MABX_B.deltariselimit_c; |
| 12119 | } else { |
| 12120 | L4_MABX_B.Switch2_f = L4_MABX_B.Switch_iv; |
| 12121 | } |
| 12122 | |
| 12123 | /* End of Switch: '<S323>/Switch2' */ |
| 12124 | |
| 12125 | /* Sum: '<S314>/Difference Inputs2' */ |
| 12126 | L4_MABX_B.DifferenceInputs2 = L4_MABX_B.Switch2_f + L4_MABX_B.Yk1; |
| 12127 | |
| 12128 | /* RelationalOperator: '<S310>/Relational Operator1' incorporates: |
| 12129 | * Constant: '<S281>/Constant' |
| 12130 | */ |
| 12131 | L4_MABX_B.RelationalOperator1_ps = (L4_MABX_B.DifferenceInputs2 >= |
| 12132 | Lateral_Control_Error_Limit); |
| 12133 | |
| 12134 | /* RelationalOperator: '<S310>/Relational Operator' incorporates: |
| 12135 | * Constant: '<S281>/Constant1' |
| 12136 | */ |
| 12137 | PositionFinalLimited = -Lateral_Control_Error_Limit; |
| 12138 | L4_MABX_B.RelationalOperator_hy = (L4_MABX_B.DifferenceInputs2 <= |
| 12139 | PositionFinalLimited); |
| 12140 | |
| 12141 | /* Outputs for Atomic SubSystem: '<S310>/If_Then_Else1' */ |
| 12142 | /* Constant: '<S281>/Constant1' */ |
| 12143 | PositionFinalLimited = -Lateral_Control_Error_Limit; |
| 12144 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_hy, PositionFinalLimited, |
| 12145 | L4_MABX_B.DifferenceInputs2, &L4_MABX_B.If_Then_Else1_k); |
| 12146 | |
| 12147 | /* End of Outputs for SubSystem: '<S310>/If_Then_Else1' */ |
| 12148 | |
| 12149 | /* Outputs for Atomic SubSystem: '<S310>/If_Then_Else' */ |
| 12150 | |
| 12151 | /* Constant: '<S281>/Constant' */ |
| 12152 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_ps, |
| 12153 | Lateral_Control_Error_Limit, |
| 12154 | L4_MABX_B.If_Then_Else1_k.Switch, |
| 12155 | &L4_MABX_B.If_Then_Else_pn); |
| 12156 | |
| 12157 | /* End of Outputs for SubSystem: '<S310>/If_Then_Else' */ |
| 12158 | |
| 12159 | /* Outputs for Atomic SubSystem: '<S281>/If_Then_Else1' */ |
| 12160 | |
| 12161 | /* Constant: '<S281>/Zero' */ |
| 12162 | L4_MABX_If_Then_Else_g(L4_MABX_B.AutonomousEnabled_d, |
| 12163 | L4_MABX_B.If_Then_Else_pn.Switch, L4_MABX_P.Zero_Value, |
| 12164 | &L4_MABX_B.If_Then_Else1_m); |
| 12165 | |
| 12166 | /* End of Outputs for SubSystem: '<S281>/If_Then_Else1' */ |
| 12167 | |
| 12168 | /* Gain: '<S313>/Proportional Gain' */ |
| 12169 | L4_MABX_B.ProportionalGain = Lateral_Control_P * |
| 12170 | L4_MABX_B.If_Then_Else1_m.Switch; |
| 12171 | |
| 12172 | /* DiscreteIntegrator: '<S313>/Integrator' */ |
| 12173 | if (L4_MABX_B.AutonomousEnabled_d && (L4_MABX_DW.Integrator_PrevResetState <= |
| 12174 | 0)) { |
| 12175 | L4_MABX_DW.Integrator_DSTATE = L4_MABX_P.Integrator_IC; |
| 12176 | } |
| 12177 | |
| 12178 | L4_MABX_B.Integrator = L4_MABX_DW.Integrator_DSTATE; |
| 12179 | |
| 12180 | /* End of DiscreteIntegrator: '<S313>/Integrator' */ |
| 12181 | |
| 12182 | /* Gain: '<S313>/Derivative Gain' */ |
| 12183 | L4_MABX_B.DerivativeGain = Lateral_Control_D * |
| 12184 | L4_MABX_B.If_Then_Else1_m.Switch; |
| 12185 | |
| 12186 | /* DiscreteIntegrator: '<S313>/Filter' */ |
| 12187 | if (L4_MABX_B.AutonomousEnabled_d && (L4_MABX_DW.Filter_PrevResetState <= 0)) |
| 12188 | { |
| 12189 | L4_MABX_DW.Filter_DSTATE = L4_MABX_P.Filter_IC; |
| 12190 | } |
| 12191 | |
| 12192 | L4_MABX_B.Filter = L4_MABX_DW.Filter_DSTATE; |
| 12193 | |
| 12194 | /* End of DiscreteIntegrator: '<S313>/Filter' */ |
| 12195 | |
| 12196 | /* Sum: '<S313>/SumD' */ |
| 12197 | L4_MABX_B.SumD = L4_MABX_B.DerivativeGain - L4_MABX_B.Filter; |
| 12198 | |
| 12199 | /* Gain: '<S313>/Filter Coefficient' */ |
| 12200 | L4_MABX_B.FilterCoefficient = L4_MABX_P.PIDController_N * L4_MABX_B.SumD; |
| 12201 | |
| 12202 | /* Sum: '<S313>/Sum' */ |
| 12203 | L4_MABX_B.Sum_c = (L4_MABX_B.ProportionalGain + L4_MABX_B.Integrator) + |
| 12204 | L4_MABX_B.FilterCoefficient; |
| 12205 | |
| 12206 | /* Saturate: '<S313>/Saturate' */ |
| 12207 | DeltaTime = L4_MABX_B.Sum_c; |
| 12208 | Time56 = L4_MABX_P.PIDController_LowerSaturationLi; |
| 12209 | AccelerationAverage = L4_MABX_P.PIDController_UpperSaturationLi; |
| 12210 | if (DeltaTime > AccelerationAverage) { |
| 12211 | L4_MABX_B.Saturate = AccelerationAverage; |
| 12212 | } else if (DeltaTime < Time56) { |
| 12213 | L4_MABX_B.Saturate = Time56; |
| 12214 | } else { |
| 12215 | L4_MABX_B.Saturate = DeltaTime; |
| 12216 | } |
| 12217 | |
| 12218 | /* End of Saturate: '<S313>/Saturate' */ |
| 12219 | |
| 12220 | /* UnitDelay: '<S317>/Delay Input' */ |
| 12221 | L4_MABX_B.Uk1_m = L4_MABX_DW.DelayInput_DSTATE; |
| 12222 | |
| 12223 | /* Gain: '<S317>/GainZero' */ |
| 12224 | L4_MABX_B.ZeroUk1 = Lateral_Control_Zero * L4_MABX_B.Uk1_m; |
| 12225 | |
| 12226 | /* UnitDelay: '<S317>/Delay Output' */ |
| 12227 | L4_MABX_B.Yk1_p = L4_MABX_DW.DelayOutput_DSTATE; |
| 12228 | |
| 12229 | /* Gain: '<S317>/GainPole' */ |
| 12230 | L4_MABX_B.PoleYk1 = Lateral_Control_Pole * L4_MABX_B.Yk1_p; |
| 12231 | |
| 12232 | /* Sum: '<S317>/Sum' */ |
| 12233 | L4_MABX_B.PoleYk1UkZeroUk1 = (L4_MABX_B.Saturate - L4_MABX_B.ZeroUk1) + |
| 12234 | L4_MABX_B.PoleYk1; |
| 12235 | |
| 12236 | /* DataTypeConversion: '<S317>/Downcast' */ |
| 12237 | L4_MABX_B.Downcast = L4_MABX_B.PoleYk1UkZeroUk1; |
| 12238 | |
| 12239 | /* Sum: '<S281>/Subtract' incorporates: |
| 12240 | * Constant: '<S281>/Constant6' |
| 12241 | */ |
| 12242 | L4_MABX_B.Subtract_c = ReAX_ActualHandwheelPos - REAX_OFFSET_APV; |
| 12243 | |
| 12244 | /* Lookup_n-D: '<S281>/1-D Lookup Table' */ |
| 12245 | L4_MABX_B.uDLookupTable_j = look1_binlxpw(L4_MABX_B.Subtract_c, |
| 12246 | L4_MABX_P.uDLookupTable_bp01Data_d, L4_MABX_P.uDLookupTable_tableData_d, 71U); |
| 12247 | |
| 12248 | /* Gain: '<S281>/deg2rad' */ |
| 12249 | L4_MABX_B.deg2rad = L4_MABX_P.deg2rad_Gain_l * L4_MABX_B.uDLookupTable_j; |
| 12250 | |
| 12251 | /* Gain: '<S281>/invert' */ |
| 12252 | L4_MABX_B.invert = L4_MABX_P.invert_Gain * L4_MABX_B.deg2rad; |
| 12253 | |
| 12254 | /* Gain: '<S281>/PGain' */ |
| 12255 | L4_MABX_B.PGain = Lateral_Control_P * L4_MABX_B.If_Then_Else_pn.Switch; |
| 12256 | |
| 12257 | /* SampleTimeMath: '<S315>/sample time' |
| 12258 | * |
| 12259 | * About '<S315>/sample time': |
| 12260 | * y = K where K = ( w * Ts ) |
| 12261 | */ |
| 12262 | L4_MABX_B.sampletime_a = L4_MABX_P.sampletime_WtEt_p; |
| 12263 | |
| 12264 | /* Product: '<S315>/delta rise limit' incorporates: |
| 12265 | * Constant: '<S281>/Constant9' |
| 12266 | */ |
| 12267 | L4_MABX_B.deltariselimit_o = Lateral_Control_Error_Rate_Limit * |
| 12268 | L4_MABX_B.sampletime_a; |
| 12269 | |
| 12270 | /* Sum: '<S281>/Sum' incorporates: |
| 12271 | * Constant: '<S281>/YAW_RATE_OFFSET_APV' |
| 12272 | */ |
| 12273 | L4_MABX_B.Sum_ly = YawRate + YAW_RATE_OFFSET_APV; |
| 12274 | |
| 12275 | /* RelationalOperator: '<S318>/Relational Operator1' incorporates: |
| 12276 | * Constant: '<S281>/Constant2' |
| 12277 | */ |
| 12278 | L4_MABX_B.RelationalOperator1_f = (L4_MABX_B.Sum_ly >= |
| 12279 | Lateral_Control_YawRate_Limit); |
| 12280 | |
| 12281 | /* RelationalOperator: '<S318>/Relational Operator' incorporates: |
| 12282 | * Constant: '<S281>/Constant4' |
| 12283 | */ |
| 12284 | PositionFinalLimited = -Lateral_Control_YawRate_Limit; |
| 12285 | L4_MABX_B.RelationalOperator_l4 = (L4_MABX_B.Sum_ly <= PositionFinalLimited); |
| 12286 | |
| 12287 | /* Outputs for Atomic SubSystem: '<S318>/If_Then_Else1' */ |
| 12288 | /* Constant: '<S281>/Constant4' */ |
| 12289 | PositionFinalLimited = -Lateral_Control_YawRate_Limit; |
| 12290 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_l4, PositionFinalLimited, |
| 12291 | L4_MABX_B.Sum_ly, &L4_MABX_B.If_Then_Else1_o0); |
| 12292 | |
| 12293 | /* End of Outputs for SubSystem: '<S318>/If_Then_Else1' */ |
| 12294 | |
| 12295 | /* Outputs for Atomic SubSystem: '<S318>/If_Then_Else' */ |
| 12296 | |
| 12297 | /* Constant: '<S281>/Constant2' */ |
| 12298 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_f, |
| 12299 | Lateral_Control_YawRate_Limit, |
| 12300 | L4_MABX_B.If_Then_Else1_o0.Switch, |
| 12301 | &L4_MABX_B.If_Then_Else_m0); |
| 12302 | |
| 12303 | /* End of Outputs for SubSystem: '<S318>/If_Then_Else' */ |
| 12304 | |
| 12305 | /* Gain: '<S281>/RateFeedbackGain' */ |
| 12306 | L4_MABX_B.RateFeedbackGain = Yaw_Rate_FF_Gain * |
| 12307 | L4_MABX_B.If_Then_Else_m0.Switch; |
| 12308 | |
| 12309 | /* MultiPortSwitch: '<S281>/Multiport Switch2' incorporates: |
| 12310 | * Constant: '<S281>/Understeer Corection' |
| 12311 | * Constant: '<S281>/Use Gain Schedule' |
| 12312 | */ |
| 12313 | if (LATERAL_GAIN_SCHEDULE_APV == ENUM_SWITCH_T_ON) { |
| 12314 | /* Lookup_n-D: '<S281>/Speed Lookup Table' */ |
| 12315 | L4_MABX_B.SpeedLookupTable = look1_binlcapw(L4_MABX_B.DataTypeConversion_k, |
| 12316 | L4_MABX_P.SpeedLookupTable_bp01Data_i, |
| 12317 | L4_MABX_P.SpeedLookupTable_tableData_k, 3U); |
| 12318 | L4_MABX_B.MultiportSwitch2 = L4_MABX_B.SpeedLookupTable; |
| 12319 | } else { |
| 12320 | L4_MABX_B.MultiportSwitch2 = UndersteerCorection; |
| 12321 | } |
| 12322 | |
| 12323 | /* End of MultiPortSwitch: '<S281>/Multiport Switch2' */ |
| 12324 | |
| 12325 | /* RelationalOperator: '<S308>/Relational Operator1' incorporates: |
| 12326 | * Constant: '<S281>/Constant3' |
| 12327 | */ |
| 12328 | L4_MABX_B.RelationalOperator1_gr = (Curvature >= |
| 12329 | Lateral_Control_Curvature_Limit); |
| 12330 | |
| 12331 | /* RelationalOperator: '<S308>/Relational Operator' incorporates: |
| 12332 | * Constant: '<S281>/Constant5' |
| 12333 | */ |
| 12334 | PositionFinalLimited = -Lateral_Control_Curvature_Limit; |
| 12335 | L4_MABX_B.RelationalOperator_o = (Curvature <= PositionFinalLimited); |
| 12336 | |
| 12337 | /* Outputs for Atomic SubSystem: '<S308>/If_Then_Else1' */ |
| 12338 | /* Constant: '<S281>/Constant5' */ |
| 12339 | PositionFinalLimited = -Lateral_Control_Curvature_Limit; |
| 12340 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_o, PositionFinalLimited, |
| 12341 | Curvature, &L4_MABX_B.If_Then_Else1_d); |
| 12342 | |
| 12343 | /* End of Outputs for SubSystem: '<S308>/If_Then_Else1' */ |
| 12344 | |
| 12345 | /* Outputs for Atomic SubSystem: '<S308>/If_Then_Else' */ |
| 12346 | |
| 12347 | /* Constant: '<S281>/Constant3' */ |
| 12348 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_gr, |
| 12349 | Lateral_Control_Curvature_Limit, |
| 12350 | L4_MABX_B.If_Then_Else1_d.Switch, |
| 12351 | &L4_MABX_B.If_Then_Else_pe); |
| 12352 | |
| 12353 | /* End of Outputs for SubSystem: '<S308>/If_Then_Else' */ |
| 12354 | |
| 12355 | /* Gain: '<S281>/FeedforwardGain' */ |
| 12356 | L4_MABX_B.FeedforwardGain = L4_MABX_P.FeedforwardGain_Gain * |
| 12357 | L4_MABX_B.If_Then_Else_pe.Switch; |
| 12358 | |
| 12359 | /* Product: '<S281>/Multiply' */ |
| 12360 | L4_MABX_B.Multiply = L4_MABX_B.MultiportSwitch2 * L4_MABX_B.FeedforwardGain; |
| 12361 | |
| 12362 | /* Sum: '<S281>/Sum2' */ |
| 12363 | L4_MABX_B.Sum2 = L4_MABX_B.Multiply - L4_MABX_B.RateFeedbackGain; |
| 12364 | |
| 12365 | /* UnitDelay: '<S315>/Delay Input2' */ |
| 12366 | L4_MABX_B.Yk1_o = L4_MABX_DW.DelayInput2_DSTATE_a; |
| 12367 | |
| 12368 | /* Sum: '<S315>/Difference Inputs1' */ |
| 12369 | L4_MABX_B.UkYk1_n = L4_MABX_B.Sum2 - L4_MABX_B.Yk1_o; |
| 12370 | |
| 12371 | /* RelationalOperator: '<S324>/LowerRelop1' */ |
| 12372 | L4_MABX_B.LowerRelop1_o = (L4_MABX_B.UkYk1_n > L4_MABX_B.deltariselimit_o); |
| 12373 | |
| 12374 | /* Product: '<S315>/delta fall limit' incorporates: |
| 12375 | * Constant: '<S281>/Constant10' |
| 12376 | */ |
| 12377 | PositionFinalLimited = -Lateral_Control_Error_Rate_Limit; |
| 12378 | L4_MABX_B.deltafalllimit_o = PositionFinalLimited * L4_MABX_B.sampletime_a; |
| 12379 | |
| 12380 | /* RelationalOperator: '<S324>/UpperRelop' */ |
| 12381 | L4_MABX_B.UpperRelop_o = (L4_MABX_B.UkYk1_n < L4_MABX_B.deltafalllimit_o); |
| 12382 | |
| 12383 | /* Switch: '<S324>/Switch' */ |
| 12384 | if (L4_MABX_B.UpperRelop_o) { |
| 12385 | L4_MABX_B.Switch_e = L4_MABX_B.deltafalllimit_o; |
| 12386 | } else { |
| 12387 | L4_MABX_B.Switch_e = L4_MABX_B.UkYk1_n; |
| 12388 | } |
| 12389 | |
| 12390 | /* End of Switch: '<S324>/Switch' */ |
| 12391 | |
| 12392 | /* Switch: '<S324>/Switch2' */ |
| 12393 | if (L4_MABX_B.LowerRelop1_o) { |
| 12394 | L4_MABX_B.Switch2_e = L4_MABX_B.deltariselimit_o; |
| 12395 | } else { |
| 12396 | L4_MABX_B.Switch2_e = L4_MABX_B.Switch_e; |
| 12397 | } |
| 12398 | |
| 12399 | /* End of Switch: '<S324>/Switch2' */ |
| 12400 | |
| 12401 | /* Sum: '<S315>/Difference Inputs2' */ |
| 12402 | L4_MABX_B.DifferenceInputs2_a = L4_MABX_B.Switch2_e + L4_MABX_B.Yk1_o; |
| 12403 | |
| 12404 | /* Sum: '<S281>/Sum3' */ |
| 12405 | L4_MABX_B.Sum3 = (L4_MABX_B.invert - L4_MABX_B.PGain) - |
| 12406 | L4_MABX_B.DifferenceInputs2_a; |
| 12407 | |
| 12408 | /* DiscreteIntegrator: '<S307>/Discrete-Time Integrator' */ |
| 12409 | if (L4_MABX_DW.DiscreteTimeIntegrator_IC_LOADI != 0) { |
| 12410 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE = L4_MABX_B.Sum3; |
| 12411 | } |
| 12412 | |
| 12413 | if (L4_MABX_B.AutonomousEnabled_d && |
| 12414 | (L4_MABX_DW.DiscreteTimeIntegrator_PrevRese <= 0)) { |
| 12415 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE = L4_MABX_B.Sum3; |
| 12416 | } |
| 12417 | |
| 12418 | L4_MABX_B.DiscreteTimeIntegrator = L4_MABX_DW.DiscreteTimeIntegrator_DSTATE; |
| 12419 | |
| 12420 | /* End of DiscreteIntegrator: '<S307>/Discrete-Time Integrator' */ |
| 12421 | |
| 12422 | /* Sum: '<S281>/Sum4' */ |
| 12423 | L4_MABX_B.Sum4 = L4_MABX_B.Downcast + L4_MABX_B.DiscreteTimeIntegrator; |
| 12424 | |
| 12425 | /* Sum: '<S281>/Sum1' */ |
| 12426 | Lateral_Control_Output = L4_MABX_B.Sum4 + L4_MABX_B.DifferenceInputs2_a; |
| 12427 | |
| 12428 | /* UnitDelay: '<S327>/Delay Input2' */ |
| 12429 | L4_MABX_B.Yk1_pm = L4_MABX_DW.DelayInput2_DSTATE_l; |
| 12430 | |
| 12431 | /* Sum: '<S327>/Difference Inputs1' */ |
| 12432 | L4_MABX_B.UkYk1_f = Lateral_Control_Output - L4_MABX_B.Yk1_pm; |
| 12433 | |
| 12434 | /* RelationalOperator: '<S329>/LowerRelop1' */ |
| 12435 | L4_MABX_B.LowerRelop1_l = (L4_MABX_B.UkYk1_f > L4_MABX_B.deltariselimit); |
| 12436 | |
| 12437 | /* Gain: '<S316>/Gain3' */ |
| 12438 | L4_MABX_B.RateLimitLower = L4_MABX_P.Gain3_Gain_p * Lateral_Control_Rate_Limit; |
| 12439 | |
| 12440 | /* Product: '<S327>/delta fall limit' */ |
| 12441 | L4_MABX_B.deltafalllimit_n = L4_MABX_B.RateLimitLower * L4_MABX_B.sampletime; |
| 12442 | |
| 12443 | /* RelationalOperator: '<S329>/UpperRelop' */ |
| 12444 | L4_MABX_B.UpperRelop_k = (L4_MABX_B.UkYk1_f < L4_MABX_B.deltafalllimit_n); |
| 12445 | |
| 12446 | /* Switch: '<S329>/Switch' */ |
| 12447 | if (L4_MABX_B.UpperRelop_k) { |
| 12448 | L4_MABX_B.Switch_f = L4_MABX_B.deltafalllimit_n; |
| 12449 | } else { |
| 12450 | L4_MABX_B.Switch_f = L4_MABX_B.UkYk1_f; |
| 12451 | } |
| 12452 | |
| 12453 | /* End of Switch: '<S329>/Switch' */ |
| 12454 | |
| 12455 | /* Switch: '<S329>/Switch2' */ |
| 12456 | if (L4_MABX_B.LowerRelop1_l) { |
| 12457 | L4_MABX_B.Switch2_fa = L4_MABX_B.deltariselimit; |
| 12458 | } else { |
| 12459 | L4_MABX_B.Switch2_fa = L4_MABX_B.Switch_f; |
| 12460 | } |
| 12461 | |
| 12462 | /* End of Switch: '<S329>/Switch2' */ |
| 12463 | |
| 12464 | /* Sum: '<S327>/Difference Inputs2' */ |
| 12465 | L4_MABX_B.DifferenceInputs2_m = L4_MABX_B.Switch2_fa + L4_MABX_B.Yk1_pm; |
| 12466 | |
| 12467 | /* RelationalOperator: '<S328>/LowerRelop1' */ |
| 12468 | L4_MABX_B.LowerRelop1_e = (L4_MABX_B.DifferenceInputs2_m > |
| 12469 | L4_MABX_B.SaturationSpeedLookup); |
| 12470 | |
| 12471 | /* Gain: '<S316>/Gain1' */ |
| 12472 | L4_MABX_B.Gain1_f = L4_MABX_P.Gain1_Gain_p * L4_MABX_B.SaturationSpeedLookup; |
| 12473 | |
| 12474 | /* RelationalOperator: '<S328>/UpperRelop' */ |
| 12475 | L4_MABX_B.UpperRelop_fl = (L4_MABX_B.DifferenceInputs2_m < L4_MABX_B.Gain1_f); |
| 12476 | |
| 12477 | /* Switch: '<S328>/Switch' */ |
| 12478 | if (L4_MABX_B.UpperRelop_fl) { |
| 12479 | L4_MABX_B.Switch_hx = L4_MABX_B.Gain1_f; |
| 12480 | } else { |
| 12481 | L4_MABX_B.Switch_hx = L4_MABX_B.DifferenceInputs2_m; |
| 12482 | } |
| 12483 | |
| 12484 | /* End of Switch: '<S328>/Switch' */ |
| 12485 | |
| 12486 | /* Switch: '<S328>/Switch2' */ |
| 12487 | if (L4_MABX_B.LowerRelop1_e) { |
| 12488 | L4_MABX_B.Switch2_k = L4_MABX_B.SaturationSpeedLookup; |
| 12489 | } else { |
| 12490 | L4_MABX_B.Switch2_k = L4_MABX_B.Switch_hx; |
| 12491 | } |
| 12492 | |
| 12493 | /* End of Switch: '<S328>/Switch2' */ |
| 12494 | |
| 12495 | /* Outputs for Atomic SubSystem: '<S316>/If_Then_Else' */ |
| 12496 | L4_MABX_If_Then_Else_k(L4_MABX_B.DataTypeConversion_l5, L4_MABX_B.Switch2_k, |
| 12497 | Lateral_Control_Output, &L4_MABX_B.If_Then_Else_c); |
| 12498 | |
| 12499 | /* End of Outputs for SubSystem: '<S316>/If_Then_Else' */ |
| 12500 | |
| 12501 | /* SignalConversion: '<S316>/TmpSignal ConversionAtIf_Then_ElseOutport1' */ |
| 12502 | Lateral_Control_Rate_Limiter_Output = L4_MABX_B.If_Then_Else_c.Switch; |
| 12503 | |
| 12504 | /* Outputs for Atomic SubSystem: '<S281>/If_Then_Else' */ |
| 12505 | L4_MABX_If_Then_Else_g(L4_MABX_B.AutonomousEnabled_d, |
| 12506 | Lateral_Control_Rate_Limiter_Output, L4_MABX_B.invert, |
| 12507 | &L4_MABX_B.If_Then_Else_m); |
| 12508 | |
| 12509 | /* End of Outputs for SubSystem: '<S281>/If_Then_Else' */ |
| 12510 | |
| 12511 | /* DataTypeConversion: '<S301>/Data Type Conversion' incorporates: |
| 12512 | * Constant: '<S301>/RATE_LIMITER_ENABLE_APV' |
| 12513 | */ |
| 12514 | L4_MABX_B.DataTypeConversion_g = (real_T)RATE_LIMITER_ENABLE_APV; |
| 12515 | |
| 12516 | /* Saturate: '<S280>/Speed Saturation' */ |
| 12517 | DeltaTime = L4_MABX_B.DataTypeConversion_k; |
| 12518 | Time56 = L4_MABX_P.SpeedSaturation_LowerSat; |
| 12519 | AccelerationAverage = L4_MABX_P.SpeedSaturation_UpperSat; |
| 12520 | if (DeltaTime > AccelerationAverage) { |
| 12521 | L4_MABX_B.SpeedSaturation = AccelerationAverage; |
| 12522 | } else if (DeltaTime < Time56) { |
| 12523 | L4_MABX_B.SpeedSaturation = Time56; |
| 12524 | } else { |
| 12525 | L4_MABX_B.SpeedSaturation = DeltaTime; |
| 12526 | } |
| 12527 | |
| 12528 | /* End of Saturate: '<S280>/Speed Saturation' */ |
| 12529 | |
| 12530 | /* Lookup_n-D: '<S301>/Saturation Speed Lookup' */ |
| 12531 | L4_MABX_B.SaturationSpeedLookup_d = look1_binlcapw(L4_MABX_B.SpeedSaturation, |
| 12532 | L4_MABX_P.SaturationSpeedLookup_bp01Dat_h, |
| 12533 | L4_MABX_P.SaturationSpeedLookup_tableDa_p, 5U); |
| 12534 | |
| 12535 | /* MultiPortSwitch: '<S301>/Multiport Switch2' incorporates: |
| 12536 | * Constant: '<S301>/Constant' |
| 12537 | * Constant: '<S301>/Use Gain Schedule' |
| 12538 | */ |
| 12539 | if (LATERAL_GAIN_SCHEDULE_APV == ENUM_SWITCH_T_ON) { |
| 12540 | /* Lookup_n-D: '<S301>/Speed Lookup Table' */ |
| 12541 | L4_MABX_B.RateSpeed_d = look1_binlcapw(L4_MABX_B.SpeedSaturation, |
| 12542 | L4_MABX_P.SpeedLookupTable_bp01Data_f, |
| 12543 | L4_MABX_P.SpeedLookupTable_tableData_c, 2U); |
| 12544 | Stanley_Rate_Limit = L4_MABX_B.RateSpeed_d; |
| 12545 | } else { |
| 12546 | Stanley_Rate_Limit = Lateral_Control_Rate_Limit_APV; |
| 12547 | } |
| 12548 | |
| 12549 | /* End of MultiPortSwitch: '<S301>/Multiport Switch2' */ |
| 12550 | |
| 12551 | /* SampleTimeMath: '<S304>/sample time' |
| 12552 | * |
| 12553 | * About '<S304>/sample time': |
| 12554 | * y = K where K = ( w * Ts ) |
| 12555 | */ |
| 12556 | L4_MABX_B.sampletime_ca = L4_MABX_P.sampletime_WtEt_e; |
| 12557 | |
| 12558 | /* Product: '<S304>/delta rise limit' */ |
| 12559 | L4_MABX_B.deltariselimit_cn = Stanley_Rate_Limit * L4_MABX_B.sampletime_ca; |
| 12560 | |
| 12561 | /* MATLAB Function: '<S280>/Error Calc' */ |
| 12562 | /* MATLAB Function 'STEERCTRL_10ms/StanleyController/Error Calc': '<S299>:1' */ |
| 12563 | /* '<S299>:1:3' */ |
| 12564 | L4_MABX_B.error = TargetAzimuth_rad - CurrentAzimuth_rad; |
| 12565 | if (L4_MABX_B.error < -3.1415926535897931) { |
| 12566 | /* '<S299>:1:5' */ |
| 12567 | /* '<S299>:1:6' */ |
| 12568 | L4_MABX_B.error += 6.2831853071795862; |
| 12569 | } else { |
| 12570 | if (L4_MABX_B.error > 3.1415926535897931) { |
| 12571 | /* '<S299>:1:7' */ |
| 12572 | /* '<S299>:1:8' */ |
| 12573 | L4_MABX_B.error -= 6.2831853071795862; |
| 12574 | } |
| 12575 | } |
| 12576 | |
| 12577 | /* End of MATLAB Function: '<S280>/Error Calc' */ |
| 12578 | |
| 12579 | /* Saturate: '<S280>/Error Saturation' */ |
| 12580 | PositionFinalLimited = -Lateral_Control_Error_Limit; |
| 12581 | DeltaTime = L4_MABX_B.error; |
| 12582 | AccelerationAverage = Lateral_Control_Error_Limit; |
| 12583 | if (DeltaTime > AccelerationAverage) { |
| 12584 | L4_MABX_B.Lateral_Control_Heading_Error_k = AccelerationAverage; |
| 12585 | } else if (DeltaTime < PositionFinalLimited) { |
| 12586 | L4_MABX_B.Lateral_Control_Heading_Error_k = PositionFinalLimited; |
| 12587 | } else { |
| 12588 | L4_MABX_B.Lateral_Control_Heading_Error_k = DeltaTime; |
| 12589 | } |
| 12590 | |
| 12591 | /* End of Saturate: '<S280>/Error Saturation' */ |
| 12592 | |
| 12593 | /* Gain: '<S280>/km//h to m//s' */ |
| 12594 | L4_MABX_B.kmhtoms = L4_MABX_P.kmhtoms_Gain * L4_MABX_B.SpeedSaturation; |
| 12595 | |
| 12596 | /* MultiPortSwitch: '<S280>/Multiport Switch1' incorporates: |
| 12597 | * Constant: '<S280>/Stanley Gain K' |
| 12598 | * Constant: '<S280>/Use Gain Schedule1' |
| 12599 | */ |
| 12600 | if (LATERAL_GAIN_SCHEDULE_APV == ENUM_SWITCH_T_ON) { |
| 12601 | /* Lookup_n-D: '<S280>/Speed Lookup Table1' */ |
| 12602 | L4_MABX_B.SpeedLookupTable1 = look1_binlcapw(L4_MABX_B.kmhtoms, |
| 12603 | L4_MABX_P.SpeedLookupTable1_bp01Data, |
| 12604 | L4_MABX_P.SpeedLookupTable1_tableData, 1U); |
| 12605 | Stanley_Set_Gain = L4_MABX_B.SpeedLookupTable1; |
| 12606 | } else { |
| 12607 | Stanley_Set_Gain = STANLEY_GAIN_APV; |
| 12608 | } |
| 12609 | |
| 12610 | /* End of MultiPortSwitch: '<S280>/Multiport Switch1' */ |
| 12611 | |
| 12612 | /* Product: '<S280>/Product' */ |
| 12613 | L4_MABX_B.Product_n = Stanley_Set_Gain * CrosstrackError; |
| 12614 | |
| 12615 | /* Sum: '<S280>/Sum' incorporates: |
| 12616 | * Constant: '<S280>/Stanley Gain Ksoft' |
| 12617 | */ |
| 12618 | L4_MABX_B.Sum_d = STANLEY_GAIN_KSOFT_APV + L4_MABX_B.kmhtoms; |
| 12619 | |
| 12620 | /* Trigonometry: '<S280>/Trigonometric Function' */ |
| 12621 | L4_MABX_B.TrigonometricFunction_l = rt_atan2d_snf(L4_MABX_B.Product_n, |
| 12622 | L4_MABX_B.Sum_d); |
| 12623 | |
| 12624 | /* Sum: '<S280>/Sum4' incorporates: |
| 12625 | * Constant: '<S280>/YAW_RATE_OFFSET_APV' |
| 12626 | */ |
| 12627 | L4_MABX_B.Sum4_h = YawRate + YAW_RATE_OFFSET_APV; |
| 12628 | |
| 12629 | /* Product: '<S280>/Product3' */ |
| 12630 | L4_MABX_B.Product3 = Curvature * L4_MABX_B.kmhtoms; |
| 12631 | |
| 12632 | /* Sum: '<S280>/Sum2' */ |
| 12633 | L4_MABX_B.Sum2_h = L4_MABX_B.Sum4_h - L4_MABX_B.Product3; |
| 12634 | |
| 12635 | /* Product: '<S280>/Product1' incorporates: |
| 12636 | * Constant: '<S280>/Stanley Gain Kdyaw' |
| 12637 | */ |
| 12638 | L4_MABX_B.Product1_iy = STANLEY_GAIN_KDYAW_APV * L4_MABX_B.Sum2_h; |
| 12639 | |
| 12640 | /* Sum: '<S280>/Subtract' incorporates: |
| 12641 | * Constant: '<S280>/ReAX Offset' |
| 12642 | */ |
| 12643 | L4_MABX_B.Subtract_e = ReAX_ActualHandwheelPos - REAX_OFFSET_APV; |
| 12644 | |
| 12645 | /* Lookup_n-D: '<S280>/1-D Lookup Table' */ |
| 12646 | L4_MABX_B.uDLookupTable_h = look1_binlxpw(L4_MABX_B.Subtract_e, |
| 12647 | L4_MABX_P.uDLookupTable_bp01Data_kh, L4_MABX_P.uDLookupTable_tableData_k, |
| 12648 | 71U); |
| 12649 | |
| 12650 | /* Gain: '<S280>/deg2rad' */ |
| 12651 | L4_MABX_B.deg2rad_o = L4_MABX_P.deg2rad_Gain_n * L4_MABX_B.uDLookupTable_h; |
| 12652 | |
| 12653 | /* Gain: '<S280>/invert' */ |
| 12654 | L4_MABX_B.invert_d = L4_MABX_P.invert_Gain_a * L4_MABX_B.deg2rad_o; |
| 12655 | |
| 12656 | /* Product: '<S280>/Multiply' */ |
| 12657 | L4_MABX_B.Multiply_a = L4_MABX_B.invert_d * L4_MABX_B.Sum4_h; |
| 12658 | |
| 12659 | /* Gain: '<S280>/Gain' */ |
| 12660 | L4_MABX_B.Gain_gm = L4_MABX_P.Gain_Gain_k * L4_MABX_B.Multiply_a; |
| 12661 | |
| 12662 | /* Sum: '<S280>/Sum3' */ |
| 12663 | L4_MABX_B.Sum3_j = L4_MABX_B.invert_d - L4_MABX_B.Gain_gm; |
| 12664 | |
| 12665 | /* Product: '<S280>/Product2' incorporates: |
| 12666 | * Constant: '<S280>/Stanley Gain Kdsteer' |
| 12667 | */ |
| 12668 | L4_MABX_B.Product2_p = STANLEY_GAIN_KDSTEER_APV * L4_MABX_B.Sum3_j; |
| 12669 | |
| 12670 | /* Gain: '<S280>/Gain2' */ |
| 12671 | L4_MABX_B.Gain2_l = L4_MABX_P.Gain2_Gain_c * Curvature; |
| 12672 | |
| 12673 | /* MultiPortSwitch: '<S280>/Multiport Switch2' incorporates: |
| 12674 | * Constant: '<S280>/Understeer Corection' |
| 12675 | * Constant: '<S280>/Use Gain Schedule' |
| 12676 | */ |
| 12677 | if (LATERAL_GAIN_SCHEDULE_APV == ENUM_SWITCH_T_ON) { |
| 12678 | /* Lookup_n-D: '<S280>/Speed Lookup Table' */ |
| 12679 | L4_MABX_B.SpeedLookupTable_a = look1_binlcapw(L4_MABX_B.kmhtoms, |
| 12680 | L4_MABX_P.SpeedLookupTable_bp01Data, L4_MABX_P.SpeedLookupTable_tableData, |
| 12681 | 1U); |
| 12682 | Understeer_Correction_Output = L4_MABX_B.SpeedLookupTable_a; |
| 12683 | } else { |
| 12684 | Understeer_Correction_Output = UndersteerCorection; |
| 12685 | } |
| 12686 | |
| 12687 | /* End of MultiPortSwitch: '<S280>/Multiport Switch2' */ |
| 12688 | |
| 12689 | /* Product: '<S280>/Multiply1' */ |
| 12690 | L4_MABX_B.Multiply1 = L4_MABX_B.Gain2_l * Understeer_Correction_Output; |
| 12691 | |
| 12692 | /* Sum: '<S280>/Sum1' */ |
| 12693 | Stanley_Output = (((L4_MABX_B.Lateral_Control_Heading_Error_k + |
| 12694 | L4_MABX_B.TrigonometricFunction_l) + L4_MABX_B.Product1_iy) |
| 12695 | + L4_MABX_B.Product2_p) + L4_MABX_B.Multiply1; |
| 12696 | |
| 12697 | /* UnitDelay: '<S304>/Delay Input2' */ |
| 12698 | L4_MABX_B.Yk1_b = L4_MABX_DW.DelayInput2_DSTATE_o; |
| 12699 | |
| 12700 | /* Sum: '<S304>/Difference Inputs1' */ |
| 12701 | L4_MABX_B.UkYk1_n2 = Stanley_Output - L4_MABX_B.Yk1_b; |
| 12702 | |
| 12703 | /* RelationalOperator: '<S306>/LowerRelop1' */ |
| 12704 | L4_MABX_B.LowerRelop1_g = (L4_MABX_B.UkYk1_n2 > L4_MABX_B.deltariselimit_cn); |
| 12705 | |
| 12706 | /* Gain: '<S301>/Gain3' */ |
| 12707 | L4_MABX_B.RateLimitLower_d = L4_MABX_P.Gain3_Gain_n * Stanley_Rate_Limit; |
| 12708 | |
| 12709 | /* Product: '<S304>/delta fall limit' */ |
| 12710 | L4_MABX_B.deltafalllimit_g = L4_MABX_B.RateLimitLower_d * |
| 12711 | L4_MABX_B.sampletime_ca; |
| 12712 | |
| 12713 | /* RelationalOperator: '<S306>/UpperRelop' */ |
| 12714 | L4_MABX_B.UpperRelop_a = (L4_MABX_B.UkYk1_n2 < L4_MABX_B.deltafalllimit_g); |
| 12715 | |
| 12716 | /* Switch: '<S306>/Switch' */ |
| 12717 | if (L4_MABX_B.UpperRelop_a) { |
| 12718 | L4_MABX_B.Switch_pt = L4_MABX_B.deltafalllimit_g; |
| 12719 | } else { |
| 12720 | L4_MABX_B.Switch_pt = L4_MABX_B.UkYk1_n2; |
| 12721 | } |
| 12722 | |
| 12723 | /* End of Switch: '<S306>/Switch' */ |
| 12724 | |
| 12725 | /* Switch: '<S306>/Switch2' */ |
| 12726 | if (L4_MABX_B.LowerRelop1_g) { |
| 12727 | L4_MABX_B.Switch2_n = L4_MABX_B.deltariselimit_cn; |
| 12728 | } else { |
| 12729 | L4_MABX_B.Switch2_n = L4_MABX_B.Switch_pt; |
| 12730 | } |
| 12731 | |
| 12732 | /* End of Switch: '<S306>/Switch2' */ |
| 12733 | |
| 12734 | /* Sum: '<S304>/Difference Inputs2' */ |
| 12735 | L4_MABX_B.DifferenceInputs2_f = L4_MABX_B.Switch2_n + L4_MABX_B.Yk1_b; |
| 12736 | |
| 12737 | /* RelationalOperator: '<S305>/LowerRelop1' */ |
| 12738 | L4_MABX_B.LowerRelop1_o1 = (L4_MABX_B.DifferenceInputs2_f > |
| 12739 | L4_MABX_B.SaturationSpeedLookup_d); |
| 12740 | |
| 12741 | /* Gain: '<S301>/Gain1' */ |
| 12742 | L4_MABX_B.Gain1_i = L4_MABX_P.Gain1_Gain_f * L4_MABX_B.SaturationSpeedLookup_d; |
| 12743 | |
| 12744 | /* RelationalOperator: '<S305>/UpperRelop' */ |
| 12745 | L4_MABX_B.UpperRelop_p = (L4_MABX_B.DifferenceInputs2_f < L4_MABX_B.Gain1_i); |
| 12746 | |
| 12747 | /* Switch: '<S305>/Switch' */ |
| 12748 | if (L4_MABX_B.UpperRelop_p) { |
| 12749 | L4_MABX_B.Switch_i1 = L4_MABX_B.Gain1_i; |
| 12750 | } else { |
| 12751 | L4_MABX_B.Switch_i1 = L4_MABX_B.DifferenceInputs2_f; |
| 12752 | } |
| 12753 | |
| 12754 | /* End of Switch: '<S305>/Switch' */ |
| 12755 | |
| 12756 | /* Switch: '<S305>/Switch2' */ |
| 12757 | if (L4_MABX_B.LowerRelop1_o1) { |
| 12758 | L4_MABX_B.Switch2_g = L4_MABX_B.SaturationSpeedLookup_d; |
| 12759 | } else { |
| 12760 | L4_MABX_B.Switch2_g = L4_MABX_B.Switch_i1; |
| 12761 | } |
| 12762 | |
| 12763 | /* End of Switch: '<S305>/Switch2' */ |
| 12764 | |
| 12765 | /* Outputs for Atomic SubSystem: '<S301>/If_Then_Else' */ |
| 12766 | L4_MABX_If_Then_Else_k(L4_MABX_B.DataTypeConversion_g, L4_MABX_B.Switch2_g, |
| 12767 | Stanley_Output, &L4_MABX_B.If_Then_Else_kz); |
| 12768 | |
| 12769 | /* End of Outputs for SubSystem: '<S301>/If_Then_Else' */ |
| 12770 | |
| 12771 | /* SignalConversion: '<S301>/TmpSignal ConversionAtIf_Then_ElseOutport1' */ |
| 12772 | Stanley_Rate_Limiter_Output = L4_MABX_B.If_Then_Else_kz.Switch; |
| 12773 | |
| 12774 | /* Outputs for Atomic SubSystem: '<S280>/If_Then_Else' */ |
| 12775 | L4_MABX_If_Then_Else_g(L4_MABX_B.AutonomousEnabled_d, |
| 12776 | Stanley_Rate_Limiter_Output, L4_MABX_B.invert_d, &L4_MABX_B.If_Then_Else_n); |
| 12777 | |
| 12778 | /* End of Outputs for SubSystem: '<S280>/If_Then_Else' */ |
| 12779 | |
| 12780 | /* MultiPortSwitch: '<S80>/Multiport Switch2' incorporates: |
| 12781 | * Constant: '<S80>/LAT_STEER_SRC_SELECTOR_APV' |
| 12782 | */ |
| 12783 | switch (LAT_STEER_SRC_SELECTOR_APV) { |
| 12784 | case ENUM_LAT_STEER_SOURCE_T_PIC_HARIS: |
| 12785 | L4_MABX_B.MultiportSwitch2_b = L4_MABX_B.If_Then_Else_m.Switch; |
| 12786 | break; |
| 12787 | |
| 12788 | case ENUM_LAT_STEER_SOURCE_T_PIC_STANLEY: |
| 12789 | L4_MABX_B.MultiportSwitch2_b = L4_MABX_B.If_Then_Else_n.Switch; |
| 12790 | break; |
| 12791 | |
| 12792 | default: |
| 12793 | /* Switch: '<S80>/Switch' */ |
| 12794 | if (TargetVelocity_kph > L4_MABX_P.Switch_Threshold) { |
| 12795 | L4_MABX_B.Switch_ph = L4_MABX_B.If_Then_Else_m.Switch; |
| 12796 | } else { |
| 12797 | L4_MABX_B.Switch_ph = L4_MABX_B.If_Then_Else_n.Switch; |
| 12798 | } |
| 12799 | |
| 12800 | /* End of Switch: '<S80>/Switch' */ |
| 12801 | L4_MABX_B.MultiportSwitch2_b = L4_MABX_B.Switch_ph; |
| 12802 | break; |
| 12803 | } |
| 12804 | |
| 12805 | /* End of MultiPortSwitch: '<S80>/Multiport Switch2' */ |
| 12806 | |
| 12807 | /* DataTypeConversion: '<S80>/Data Type Conversion6' */ |
| 12808 | L4_MABX_B.DataTypeConversion6_pa = L4_MABX_B.MultiportSwitch2_b; |
| 12809 | |
| 12810 | /* Gain: '<S80>/rad2deg' */ |
| 12811 | L4_MABX_B.rad2deg = L4_MABX_P.rad2deg_Gain * L4_MABX_B.DataTypeConversion6_pa; |
| 12812 | |
| 12813 | /* Gain: '<S80>/sign flip' */ |
| 12814 | SteerCommandDeg = L4_MABX_P.signflip_Gain * L4_MABX_B.rad2deg; |
| 12815 | |
| 12816 | /* MultiPortSwitch: '<S80>/Multiport Switch1' incorporates: |
| 12817 | * Constant: '<S80>/LONG_SPEED_SRC_SELECTOR_APV' |
| 12818 | * Constant: '<S80>/SteeringOverrideVal1' |
| 12819 | */ |
| 12820 | switch (LONG_SPEED_SRC_SELECTOR_APV) { |
| 12821 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH: |
| 12822 | /* MultiPortSwitch: '<S80>/Multiport Switch' incorporates: |
| 12823 | * Constant: '<S80>/SteeringControlSRC' |
| 12824 | * Constant: '<S80>/SteeringOverrideVal' |
| 12825 | */ |
| 12826 | switch (L4_MABX_P.SteeringControlSRC_Value) { |
| 12827 | case 0: |
| 12828 | L4_MABX_B.MultiportSwitch_f = L4_MABX_P.SteeringOverrideVal_Value; |
| 12829 | break; |
| 12830 | |
| 12831 | case 1: |
| 12832 | L4_MABX_B.MultiportSwitch_f = L4_MABX_B.Switch2_i; |
| 12833 | break; |
| 12834 | |
| 12835 | case 2: |
| 12836 | /* DataTypeConversion: '<S80>/Data Type Conversion2' */ |
| 12837 | L4_MABX_B.DataTypeConversion2_o = L4_MABX_B.Add2; |
| 12838 | L4_MABX_B.MultiportSwitch_f = L4_MABX_B.DataTypeConversion2_o; |
| 12839 | break; |
| 12840 | |
| 12841 | default: |
| 12842 | /* DataTypeConversion: '<S80>/Data Type Conversion3' */ |
| 12843 | L4_MABX_B.DataTypeConversion3_p = L4_MABX_B.Add1_hl; |
| 12844 | L4_MABX_B.MultiportSwitch_f = L4_MABX_B.DataTypeConversion3_p; |
| 12845 | break; |
| 12846 | } |
| 12847 | |
| 12848 | /* End of MultiPortSwitch: '<S80>/Multiport Switch' */ |
| 12849 | |
| 12850 | /* Gain: '<S80>/rad2deg2' */ |
| 12851 | L4_MABX_B.rad2deg2 = L4_MABX_P.rad2deg2_Gain * L4_MABX_B.MultiportSwitch_f; |
| 12852 | L4_MABX_B.MultiportSwitch1 = L4_MABX_B.rad2deg2; |
| 12853 | break; |
| 12854 | |
| 12855 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE: |
| 12856 | L4_MABX_B.MultiportSwitch1 = L4_MABX_P.SteeringOverrideVal1_Value; |
| 12857 | break; |
| 12858 | |
| 12859 | default: |
| 12860 | L4_MABX_B.MultiportSwitch1 = SteerCommandDeg; |
| 12861 | break; |
| 12862 | } |
| 12863 | |
| 12864 | /* End of MultiPortSwitch: '<S80>/Multiport Switch1' */ |
| 12865 | |
| 12866 | /* Lookup_n-D: '<S276>/1D_Lookup_Table' */ |
| 12867 | L4_MABX_B.uD_Lookup_Table_a = look1_binlcapw(L4_MABX_B.MultiportSwitch1, |
| 12868 | STEERCTRL_WHEEL_ANGLE_STEP_MPV, STEERCTRL_WHEEL_ANGLE_DATA_MPV, 71U); |
| 12869 | |
| 12870 | /* DataTypeConversion: '<S80>/Data Type Conversion4' */ |
| 12871 | L4_MABX_B.numLanePoints_j = L4_MABX_B.DataTypeConversion5_e3; |
| 12872 | |
| 12873 | /* DiscreteIntegrator: '<S80>/Discrete-Time Integrator' incorporates: |
| 12874 | * Constant: '<S80>/ResetIntegrator' |
| 12875 | */ |
| 12876 | if ((L4_MABX_P.ResetIntegrator_Value != 0.0) || |
| 12877 | (L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e != 0)) { |
| 12878 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e = |
| 12879 | L4_MABX_P.DiscreteTimeIntegrator_IC; |
| 12880 | } |
| 12881 | |
| 12882 | if (L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e >= |
| 12883 | L4_MABX_P.DiscreteTimeIntegrator_UpperSat) { |
| 12884 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e = |
| 12885 | L4_MABX_P.DiscreteTimeIntegrator_UpperSat; |
| 12886 | } else { |
| 12887 | if (L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e <= |
| 12888 | L4_MABX_P.DiscreteTimeIntegrator_LowerSat) { |
| 12889 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e = |
| 12890 | L4_MABX_P.DiscreteTimeIntegrator_LowerSat; |
| 12891 | } |
| 12892 | } |
| 12893 | |
| 12894 | L4_MABX_B.DiscreteTimeIntegrator_h = |
| 12895 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e; |
| 12896 | |
| 12897 | /* End of DiscreteIntegrator: '<S80>/Discrete-Time Integrator' */ |
| 12898 | |
| 12899 | /* RelationalOperator: '<S288>/Lower Test' incorporates: |
| 12900 | * Constant: '<S288>/Lower Limit' |
| 12901 | */ |
| 12902 | L4_MABX_B.LowerTest = (L4_MABX_P.IntervalTest_lowlimit <= L4_MABX_B.Divide_nn); |
| 12903 | |
| 12904 | /* RelationalOperator: '<S288>/Upper Test' incorporates: |
| 12905 | * Constant: '<S288>/Upper Limit' |
| 12906 | */ |
| 12907 | L4_MABX_B.UpperTest = (L4_MABX_B.Divide_nn <= L4_MABX_P.IntervalTest_uplimit); |
| 12908 | |
| 12909 | /* Logic: '<S288>/AND' */ |
| 12910 | L4_MABX_B.AND_p = (L4_MABX_B.LowerTest && L4_MABX_B.UpperTest); |
| 12911 | |
| 12912 | /* Assertion: '<S285>/Assertion' */ |
| 12913 | utAssert(L4_MABX_B.AND_p); |
| 12914 | |
| 12915 | /* RelationalOperator: '<S293>/Lower Test' incorporates: |
| 12916 | * Constant: '<S293>/Lower Limit' |
| 12917 | */ |
| 12918 | L4_MABX_B.LowerTest_l = (L4_MABX_P.IntervalTest_lowlimit_k <= |
| 12919 | L4_MABX_B.Divide_d0); |
| 12920 | |
| 12921 | /* RelationalOperator: '<S293>/Upper Test' incorporates: |
| 12922 | * Constant: '<S293>/Upper Limit' |
| 12923 | */ |
| 12924 | L4_MABX_B.UpperTest_e = (L4_MABX_B.Divide_d0 <= |
| 12925 | L4_MABX_P.IntervalTest_uplimit_e); |
| 12926 | |
| 12927 | /* Logic: '<S293>/AND' */ |
| 12928 | L4_MABX_B.AND_jt = (L4_MABX_B.LowerTest_l && L4_MABX_B.UpperTest_e); |
| 12929 | |
| 12930 | /* Assertion: '<S290>/Assertion' */ |
| 12931 | utAssert(L4_MABX_B.AND_jt); |
| 12932 | |
| 12933 | /* Switch: '<S296>/Switch' incorporates: |
| 12934 | * Constant: '<S279>/Constant8' |
| 12935 | * Constant: '<S279>/Constant9' |
| 12936 | */ |
| 12937 | if (L4_MABX_P.Constant8_Value_l) { |
| 12938 | L4_MABX_B.Switch_k = L4_MABX_P.Constant9_Value; |
| 12939 | } else { |
| 12940 | L4_MABX_B.Switch_k = L4_MABX_B.Add_px; |
| 12941 | } |
| 12942 | |
| 12943 | /* End of Switch: '<S296>/Switch' */ |
| 12944 | |
| 12945 | /* RelationalOperator: '<S80>/Relational Operator' incorporates: |
| 12946 | * Constant: '<S80>/Constant1' |
| 12947 | */ |
| 12948 | L4_MABX_B.RelationalOperator_oq = (L4_MABX_B.DataTypeConversion5_e3 >= |
| 12949 | L4_MABX_P.Constant1_Value_ls); |
| 12950 | |
| 12951 | /* Sum: '<S301>/Subtract' */ |
| 12952 | L4_MABX_B.Subtract_gn = Stanley_Output - L4_MABX_B.DifferenceInputs2_f; |
| 12953 | |
| 12954 | /* Abs: '<S301>/Abs2' */ |
| 12955 | L4_MABX_B.Abs2_i = fabs(L4_MABX_B.Subtract_gn); |
| 12956 | |
| 12957 | /* RelationalOperator: '<S302>/Compare' incorporates: |
| 12958 | * Constant: '<S302>/Constant' |
| 12959 | */ |
| 12960 | Stanley_Limiter_Active = (L4_MABX_B.Abs2_i > |
| 12961 | L4_MABX_P.CompareToConstant_const_f); |
| 12962 | |
| 12963 | /* Abs: '<S301>/Abs1' */ |
| 12964 | L4_MABX_B.Abs1_p = fabs(L4_MABX_B.Lateral_Control_Heading_Error_k); |
| 12965 | |
| 12966 | /* Lookup_n-D: '<S301>/Error Lookup Table' */ |
| 12967 | L4_MABX_B.RateError = look1_binlcapw(L4_MABX_B.Abs1_p, |
| 12968 | L4_MABX_P.ErrorLookupTable_bp01Data, L4_MABX_P.ErrorLookupTable_tableData, |
| 12969 | 4U); |
| 12970 | |
| 12971 | /* RateLimiter: '<S301>/Limit Rate Limiter' */ |
| 12972 | PositionFinalLimited = L4_MABX_B.RateError - L4_MABX_DW.PrevY; |
| 12973 | if (PositionFinalLimited > L4_MABX_P.LimitRateLimiter_RisingLim) { |
| 12974 | L4_MABX_B.LimitRateLimiter = L4_MABX_DW.PrevY + |
| 12975 | L4_MABX_P.LimitRateLimiter_RisingLim; |
| 12976 | } else if (PositionFinalLimited < L4_MABX_P.LimitRateLimiter_FallingLim) { |
| 12977 | L4_MABX_B.LimitRateLimiter = L4_MABX_DW.PrevY + |
| 12978 | L4_MABX_P.LimitRateLimiter_FallingLim; |
| 12979 | } else { |
| 12980 | L4_MABX_B.LimitRateLimiter = L4_MABX_B.RateError; |
| 12981 | } |
| 12982 | |
| 12983 | L4_MABX_DW.PrevY = L4_MABX_B.LimitRateLimiter; |
| 12984 | |
| 12985 | /* End of RateLimiter: '<S301>/Limit Rate Limiter' */ |
| 12986 | |
| 12987 | /* Gain: '<S307>/Gain' */ |
| 12988 | L4_MABX_B.Gain_o = L4_MABX_P.Gain_Gain_p * L4_MABX_B.DiscreteTimeIntegrator; |
| 12989 | |
| 12990 | /* Gain: '<S313>/Integral Gain' */ |
| 12991 | L4_MABX_B.IntegralGain = Lateral_Control_I * L4_MABX_B.If_Then_Else1_m.Switch; |
| 12992 | |
| 12993 | /* Abs: '<S316>/Abs' */ |
| 12994 | L4_MABX_B.Abs_ig = fabs(L4_MABX_B.If_Then_Else_pe.Switch); |
| 12995 | |
| 12996 | /* Abs: '<S316>/Abs1' */ |
| 12997 | L4_MABX_B.Abs1_ft = fabs(L4_MABX_B.DifferenceInputs2); |
| 12998 | |
| 12999 | /* Sum: '<S316>/Subtract' */ |
| 13000 | L4_MABX_B.Subtract_o = Lateral_Control_Output - L4_MABX_B.DifferenceInputs2_m; |
| 13001 | |
| 13002 | /* Abs: '<S316>/Abs2' */ |
| 13003 | L4_MABX_B.Abs2_k = fabs(L4_MABX_B.Subtract_o); |
| 13004 | |
| 13005 | /* RelationalOperator: '<S325>/Compare' incorporates: |
| 13006 | * Constant: '<S325>/Constant' |
| 13007 | */ |
| 13008 | RateLimiterActive = (L4_MABX_B.Abs2_k > L4_MABX_P.CompareToConstant_const_g); |
| 13009 | |
| 13010 | /* Lookup_n-D: '<S316>/Curvature Lookup Table' */ |
| 13011 | L4_MABX_B.RateCurvature = look1_binlcapw(L4_MABX_B.Abs_ig, |
| 13012 | L4_MABX_P.CurvatureLookupTable_bp01Data, |
| 13013 | L4_MABX_P.CurvatureLookupTable_tableData, 4U); |
| 13014 | |
| 13015 | /* Lookup_n-D: '<S316>/Error Lookup Table' */ |
| 13016 | L4_MABX_B.RateError_o = look1_binlcapw(L4_MABX_B.Abs1_ft, |
| 13017 | L4_MABX_P.ErrorLookupTable_bp01Data_j, |
| 13018 | L4_MABX_P.ErrorLookupTable_tableData_e, 4U); |
| 13019 | |
| 13020 | /* MinMax: '<S316>/Max' */ |
| 13021 | DeltaTime = L4_MABX_B.RateCurvature; |
| 13022 | PositionFinalLimited = L4_MABX_B.RateError_o; |
| 13023 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 13024 | PositionFinalLimited = DeltaTime; |
| 13025 | } |
| 13026 | |
| 13027 | L4_MABX_B.Max = PositionFinalLimited; |
| 13028 | |
| 13029 | /* End of MinMax: '<S316>/Max' */ |
| 13030 | |
| 13031 | /* Lookup_n-D: '<S316>/Speed Lookup Table' */ |
| 13032 | L4_MABX_B.RateSpeed = look1_binlcapw(L4_MABX_B.DataTypeConversion_k, |
| 13033 | L4_MABX_P.SpeedLookupTable_bp01Data_a, |
| 13034 | L4_MABX_P.SpeedLookupTable_tableData_co, 5U); |
| 13035 | |
| 13036 | /* MinMax: '<S316>/Min' */ |
| 13037 | DeltaTime = L4_MABX_B.Max; |
| 13038 | PositionFinalLimited = L4_MABX_B.RateSpeed; |
| 13039 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 13040 | PositionFinalLimited = DeltaTime; |
| 13041 | } |
| 13042 | |
| 13043 | L4_MABX_B.Min = PositionFinalLimited; |
| 13044 | |
| 13045 | /* End of MinMax: '<S316>/Min' */ |
| 13046 | |
| 13047 | /* RateLimiter: '<S316>/Limit Rate Limiter' */ |
| 13048 | PositionFinalLimited = L4_MABX_B.Min - L4_MABX_DW.PrevY_o; |
| 13049 | if (PositionFinalLimited > L4_MABX_P.LimitRateLimiter_RisingLim_d) { |
| 13050 | L4_MABX_B.RateLimitUpper = L4_MABX_DW.PrevY_o + |
| 13051 | L4_MABX_P.LimitRateLimiter_RisingLim_d; |
| 13052 | } else if (PositionFinalLimited < L4_MABX_P.LimitRateLimiter_FallingLim_j) { |
| 13053 | L4_MABX_B.RateLimitUpper = L4_MABX_DW.PrevY_o + |
| 13054 | L4_MABX_P.LimitRateLimiter_FallingLim_j; |
| 13055 | } else { |
| 13056 | L4_MABX_B.RateLimitUpper = L4_MABX_B.Min; |
| 13057 | } |
| 13058 | |
| 13059 | L4_MABX_DW.PrevY_o = L4_MABX_B.RateLimitUpper; |
| 13060 | |
| 13061 | /* End of RateLimiter: '<S316>/Limit Rate Limiter' */ |
| 13062 | |
| 13063 | /* Gain: '<S80>/sign2' */ |
| 13064 | DesiredSteeringAngle = L4_MABX_P.sign2_Gain * L4_MABX_B.uD_Lookup_Table_a; |
| 13065 | |
| 13066 | /* Sum: '<S80>/Subtract' incorporates: |
| 13067 | * Constant: '<S80>/Constant' |
| 13068 | */ |
| 13069 | L4_MABX_B.Subtract_c1 = DesiredSteeringAngle + REAX_OFFSET_APV; |
| 13070 | |
| 13071 | /* UnitDelay: '<S80>/Unit Delay' */ |
| 13072 | L4_MABX_B.UnitDelay_p = L4_MABX_DW.UnitDelay_DSTATE_e; |
| 13073 | |
| 13074 | /* Switch: '<S80>/Switch1' incorporates: |
| 13075 | * Constant: '<S80>/Constant2' |
| 13076 | * Switch: '<S80>/Switch2' |
| 13077 | */ |
| 13078 | if (L4_MABX_B.RelationalOperator_oq) { |
| 13079 | /* Product: '<S80>/Product3' incorporates: |
| 13080 | * Constant: '<S80>/SteeringControlNewIGain1' |
| 13081 | */ |
| 13082 | L4_MABX_B.Product3_b = L4_MABX_B.mm2m * |
| 13083 | L4_MABX_P.SteeringControlNewIGain1_Value; |
| 13084 | L4_MABX_B.Switch1_p = L4_MABX_B.Product3_b; |
| 13085 | |
| 13086 | /* Gain: '<S80>/deg2rad' */ |
| 13087 | L4_MABX_B.deg2rad_d = L4_MABX_P.deg2rad_Gain * L4_MABX_B.SFunction1_o1_oq; |
| 13088 | |
| 13089 | /* Product: '<S80>/Product2' incorporates: |
| 13090 | * Constant: '<S80>/SteeringControlNewPGain1' |
| 13091 | */ |
| 13092 | L4_MABX_B.Product2_my = L4_MABX_B.deg2rad_d * |
| 13093 | L4_MABX_P.SteeringControlNewPGain1_Value; |
| 13094 | L4_MABX_B.Switch2_i1 = L4_MABX_B.Product2_my; |
| 13095 | } else { |
| 13096 | L4_MABX_B.Switch1_p = L4_MABX_P.Constant2_Value_n; |
| 13097 | L4_MABX_B.Switch2_i1 = L4_MABX_B.UnitDelay_p; |
| 13098 | } |
| 13099 | |
| 13100 | /* End of Switch: '<S80>/Switch1' */ |
| 13101 | |
| 13102 | /* RelationalOperator: '<S359>/min_relop' incorporates: |
| 13103 | * Constant: '<S359>/min_val' |
| 13104 | */ |
| 13105 | L4_MABX_B.min_relop_k = (L4_MABX_P.CheckStaticLowerBound_min_o <= |
| 13106 | L4_MABX_B.Divide_e); |
| 13107 | |
| 13108 | /* Assertion: '<S359>/Assertion' */ |
| 13109 | utAssert(L4_MABX_B.min_relop_k); |
| 13110 | |
| 13111 | /* Logic: '<S368>/Logical Operator2' */ |
| 13112 | L4_MABX_B.LogicalOperator2_g = !L4_MABX_B.LogicalOperator1_ph; |
| 13113 | |
| 13114 | /* Switch: '<S377>/Reset' incorporates: |
| 13115 | * Constant: '<S372>/CPV' |
| 13116 | */ |
| 13117 | if (L4_MABX_B.LogicalOperator1_ja) { |
| 13118 | L4_MABX_B.Xnew = L4_MABX_P.CPV_Value_h; |
| 13119 | } else { |
| 13120 | L4_MABX_B.Xnew = L4_MABX_B.If_Then_Else_gf.Switch; |
| 13121 | } |
| 13122 | |
| 13123 | /* End of Switch: '<S377>/Reset' */ |
| 13124 | |
| 13125 | /* UnitDelay: '<S379>/FixPt Unit Delay2' */ |
| 13126 | L4_MABX_B.FixPtUnitDelay2_j = L4_MABX_DW.FixPtUnitDelay2_DSTATE_aw; |
| 13127 | |
| 13128 | /* Logic: '<S379>/FixPt Logical Operator' */ |
| 13129 | L4_MABX_B.FixPtLogicalOperator_i = (uint8_T)(L4_MABX_B.LogicalOperator1_ja || |
| 13130 | (L4_MABX_B.FixPtUnitDelay2_j != 0)); |
| 13131 | |
| 13132 | /* UnitDelay: '<S379>/FixPt Unit Delay1' */ |
| 13133 | L4_MABX_B.Xold_dp = L4_MABX_DW.FixPtUnitDelay1_DSTATE_p; |
| 13134 | |
| 13135 | /* Switch: '<S379>/Init' incorporates: |
| 13136 | * Constant: '<S373>/CPV' |
| 13137 | */ |
| 13138 | if (L4_MABX_B.FixPtLogicalOperator_i != 0) { |
| 13139 | L4_MABX_B.Init_o = L4_MABX_P.CPV_Value_n; |
| 13140 | } else { |
| 13141 | L4_MABX_B.Init_o = L4_MABX_B.Xold_dp; |
| 13142 | } |
| 13143 | |
| 13144 | /* End of Switch: '<S379>/Init' */ |
| 13145 | |
| 13146 | /* UnitDelay: '<S380>/FixPt Unit Delay2' */ |
| 13147 | L4_MABX_B.FixPtUnitDelay2_m = L4_MABX_DW.FixPtUnitDelay2_DSTATE_gx; |
| 13148 | |
| 13149 | /* Logic: '<S380>/FixPt Logical Operator' */ |
| 13150 | L4_MABX_B.FixPtLogicalOperator_b = (uint8_T)(L4_MABX_B.LogicalOperator1_ja || |
| 13151 | (L4_MABX_B.FixPtUnitDelay2_m != 0)); |
| 13152 | |
| 13153 | /* UnitDelay: '<S380>/FixPt Unit Delay1' */ |
| 13154 | L4_MABX_B.Xold_m = L4_MABX_DW.FixPtUnitDelay1_DSTATE_g0; |
| 13155 | |
| 13156 | /* Switch: '<S380>/Init' incorporates: |
| 13157 | * Constant: '<S371>/CPV2' |
| 13158 | */ |
| 13159 | if (L4_MABX_B.FixPtLogicalOperator_b != 0) { |
| 13160 | L4_MABX_B.Init_l = L4_MABX_P.CPV2_Value_p; |
| 13161 | } else { |
| 13162 | L4_MABX_B.Init_l = L4_MABX_B.Xold_m; |
| 13163 | } |
| 13164 | |
| 13165 | /* End of Switch: '<S380>/Init' */ |
| 13166 | |
| 13167 | /* MultiPortSwitch: '<S378>/Multiport Switch' incorporates: |
| 13168 | * Constant: '<S371>/CPV2' |
| 13169 | * Constant: '<S378>/Integrator_method' |
| 13170 | */ |
| 13171 | switch ((int32_T)L4_MABX_P.Integrator_method_Value) { |
| 13172 | case 1: |
| 13173 | L4_MABX_B.MultiportSwitch_i = L4_MABX_P.CPV2_Value_p; |
| 13174 | break; |
| 13175 | |
| 13176 | case 2: |
| 13177 | L4_MABX_B.MultiportSwitch_i = L4_MABX_B.Init_l; |
| 13178 | break; |
| 13179 | |
| 13180 | default: |
| 13181 | /* Sum: '<S378>/Add' incorporates: |
| 13182 | * Constant: '<S371>/CPV2' |
| 13183 | */ |
| 13184 | L4_MABX_B.Add_py = L4_MABX_B.Init_l + L4_MABX_P.CPV2_Value_p; |
| 13185 | |
| 13186 | /* Gain: '<S378>/Gain' */ |
| 13187 | L4_MABX_B.u_trapezoidal = L4_MABX_P.Gain_Gain_j * L4_MABX_B.Add_py; |
| 13188 | L4_MABX_B.MultiportSwitch_i = L4_MABX_B.u_trapezoidal; |
| 13189 | break; |
| 13190 | } |
| 13191 | |
| 13192 | /* End of MultiPortSwitch: '<S378>/Multiport Switch' */ |
| 13193 | |
| 13194 | /* DigitalClock: '<S374>/Digital Clock' */ |
| 13195 | L4_MABX_B.DigitalClock_d = L4_MABX_M->Timing.t[0]; |
| 13196 | |
| 13197 | /* UnitDelay: '<S374>/Unit_Delay' */ |
| 13198 | L4_MABX_B.Unit_Delay_p = L4_MABX_DW.Unit_Delay_DSTATE_j; |
| 13199 | |
| 13200 | /* Sum: '<S374>/Subtract' */ |
| 13201 | L4_MABX_B.Subtract_k = L4_MABX_B.DigitalClock_d - L4_MABX_B.Unit_Delay_p; |
| 13202 | |
| 13203 | /* Product: '<S373>/Product1' incorporates: |
| 13204 | * Constant: '<S371>/CPV' |
| 13205 | */ |
| 13206 | L4_MABX_B.Product1_am = L4_MABX_P.CPV_Value_g * L4_MABX_B.MultiportSwitch_i * |
| 13207 | L4_MABX_B.Subtract_k; |
| 13208 | |
| 13209 | /* Sum: '<S373>/Add' */ |
| 13210 | L4_MABX_B.Add_db = L4_MABX_B.Init_o + L4_MABX_B.Product1_am; |
| 13211 | |
| 13212 | /* Switch: '<S380>/Reset' incorporates: |
| 13213 | * Constant: '<S371>/CPV2' |
| 13214 | */ |
| 13215 | L4_MABX_B.Xnew_f = L4_MABX_P.CPV2_Value_p; |
| 13216 | |
| 13217 | /* Switch: '<S379>/Reset' incorporates: |
| 13218 | * Constant: '<S373>/CPV' |
| 13219 | */ |
| 13220 | if (L4_MABX_B.LogicalOperator1_ja) { |
| 13221 | L4_MABX_B.Xnew_h = L4_MABX_P.CPV_Value_n; |
| 13222 | } else { |
| 13223 | L4_MABX_B.Xnew_h = L4_MABX_B.Add_db; |
| 13224 | } |
| 13225 | |
| 13226 | /* End of Switch: '<S379>/Reset' */ |
| 13227 | |
| 13228 | /* RelationalOperator: '<S387>/min_relop' incorporates: |
| 13229 | * Constant: '<S351>/FCW_CTRL_SLEW_INC_APV' |
| 13230 | * Constant: '<S387>/min_val' |
| 13231 | */ |
| 13232 | L4_MABX_B.min_relop_cb = (L4_MABX_P.CheckStaticLowerBound_min_h <= |
| 13233 | L4_MABX_P.FCW_CTRL_SLEW_INC_APV_Value); |
| 13234 | |
| 13235 | /* Assertion: '<S387>/Assertion' */ |
| 13236 | utAssert(L4_MABX_B.min_relop_cb); |
| 13237 | |
| 13238 | /* RelationalOperator: '<S398>/min_relop' incorporates: |
| 13239 | * Constant: '<S353>/STABILITY_CTRL_SLEW_INC_APV' |
| 13240 | * Constant: '<S398>/min_val' |
| 13241 | */ |
| 13242 | L4_MABX_B.min_relop_f = (L4_MABX_P.CheckStaticLowerBound_min_nz <= |
| 13243 | L4_MABX_P.STABILITY_CTRL_SLEW_INC_APV_Val); |
| 13244 | |
| 13245 | /* Assertion: '<S398>/Assertion' */ |
| 13246 | utAssert(L4_MABX_B.min_relop_f); |
| 13247 | |
| 13248 | /* End of Outputs for SubSystem: '<S65>/Task_10ms' */ |
| 13249 | |
| 13250 | /* Outputs for Enabled SubSystem: '<S631>/PosRapidUpdate_011' incorporates: |
| 13251 | * EnablePort: '<S632>/Enable' |
| 13252 | */ |
| 13253 | /* Constant: '<S454>/Constant' */ |
| 13254 | if (L4_MABX_P.Constant_Value_ba > 0.0) { |
| 13255 | /* S-Function (rti_commonblock): '<S632>/S-Function1' */ |
| 13256 | /* This comment workarounds a code generation problem */ |
| 13257 | |
| 13258 | /* dSPACE RTICAN RX Message Block: "PosRapidUpdate_01" Id:167248128 */ |
| 13259 | { |
| 13260 | UInt32 *CAN_Msg; |
| 13261 | static dsfloat time_old = 0.0; |
| 13262 | |
| 13263 | /* Read status and timestamp info (previous message) */ |
| 13264 | if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80100].timestamp != |
| 13265 | time_old) { |
| 13266 | /* ... save timestamp info for the calculation of the RX status |
| 13267 | during the consecutive sample hit*/ |
| 13268 | time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80100]. |
| 13269 | timestamp; |
| 13270 | |
| 13271 | /* ... set the processed flag to one */ |
| 13272 | L4_MABX_B.SFunction1_o3_bt = 1.0; |
| 13273 | L4_MABX_B.SFunction1_o4_ez = (real_T) |
| 13274 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80100].timestamp; |
| 13275 | L4_MABX_B.SFunction1_o5_gx = (real_T) |
| 13276 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80100].deltatime; |
| 13277 | CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80100].data; |
| 13278 | |
| 13279 | /* Decode CAN message */ |
| 13280 | { |
| 13281 | { |
| 13282 | rtican_Signal_t CAN_Sgn; |
| 13283 | |
| 13284 | /* ...... "Latitude_" (0|32, standard signal, signed int, little endian) */ |
| 13285 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 13286 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 13287 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[2]; |
| 13288 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[3]; |
| 13289 | L4_MABX_B.SFunction1_o1_bh = 1.0E-7 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 13290 | ); |
| 13291 | |
| 13292 | /* ...... "Longitude_" (32|32, standard signal, signed int, little endian) */ |
| 13293 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 13294 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 13295 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[6]; |
| 13296 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[7]; |
| 13297 | L4_MABX_B.SFunction1_o2_db = 1.0E-7 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 13298 | ); |
| 13299 | } |
| 13300 | } |
| 13301 | } else { |
| 13302 | /* set RX status to 0 because no new message has arrived */ |
| 13303 | L4_MABX_B.SFunction1_o3_bt = 0.0; |
| 13304 | } |
| 13305 | } |
| 13306 | } |
| 13307 | |
| 13308 | /* End of Outputs for SubSystem: '<S631>/PosRapidUpdate_011' */ |
| 13309 | |
| 13310 | /* Outputs for Atomic SubSystem: '<S472>/If_Then_Else' */ |
| 13311 | |
| 13312 | /* Constant: '<S472>/useGPSSA00' incorporates: |
| 13313 | * Constant: '<S472>/useGPSSA0' |
| 13314 | */ |
| 13315 | L4_MABX_If_Then_Else3(L4_MABX_B.LogicalOperator1_c, L4_MABX_P.useGPSSA00_Value, |
| 13316 | L4_MABX_P.useGPSSA0_Value, &L4_MABX_B.If_Then_Else); |
| 13317 | |
| 13318 | /* End of Outputs for SubSystem: '<S472>/If_Then_Else' */ |
| 13319 | |
| 13320 | /* Outputs for Enabled SubSystem: '<S631>/PosRapidUpdate_1' incorporates: |
| 13321 | * EnablePort: '<S633>/Enable' |
| 13322 | */ |
| 13323 | /* Constant: '<S454>/Constant' */ |
| 13324 | if (L4_MABX_P.Constant_Value_ba > 0.0) { |
| 13325 | /* S-Function (rti_commonblock): '<S633>/S-Function1' */ |
| 13326 | /* This comment workarounds a code generation problem */ |
| 13327 | |
| 13328 | /* dSPACE RTICAN RX Message Block: "PosRapidUpdate_01" Id:167248129 */ |
| 13329 | { |
| 13330 | UInt32 *CAN_Msg; |
| 13331 | static dsfloat time_old = 0.0; |
| 13332 | |
| 13333 | /* Read status and timestamp info (previous message) */ |
| 13334 | if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80101].timestamp != |
| 13335 | time_old) { |
| 13336 | /* ... save timestamp info for the calculation of the RX status |
| 13337 | during the consecutive sample hit*/ |
| 13338 | time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80101]. |
| 13339 | timestamp; |
| 13340 | |
| 13341 | /* ... set the processed flag to one */ |
| 13342 | L4_MABX_B.SFunction1_o3_a = 1.0; |
| 13343 | L4_MABX_B.SFunction1_o4_ex = (real_T) |
| 13344 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80101].timestamp; |
| 13345 | L4_MABX_B.SFunction1_o5_nb = (real_T) |
| 13346 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80101].deltatime; |
| 13347 | CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80101].data; |
| 13348 | |
| 13349 | /* Decode CAN message */ |
| 13350 | { |
| 13351 | { |
| 13352 | rtican_Signal_t CAN_Sgn; |
| 13353 | |
| 13354 | /* ...... "Latitude_" (0|32, standard signal, signed int, little endian) */ |
| 13355 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 13356 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 13357 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[2]; |
| 13358 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[3]; |
| 13359 | L4_MABX_B.SFunction1_o1_ju = 1.0E-7 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 13360 | ); |
| 13361 | |
| 13362 | /* ...... "Longitude_" (32|32, standard signal, signed int, little endian) */ |
| 13363 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 13364 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 13365 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[6]; |
| 13366 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[7]; |
| 13367 | L4_MABX_B.SFunction1_o2_aq = 1.0E-7 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 13368 | ); |
| 13369 | } |
| 13370 | } |
| 13371 | } else { |
| 13372 | /* set RX status to 0 because no new message has arrived */ |
| 13373 | L4_MABX_B.SFunction1_o3_a = 0.0; |
| 13374 | } |
| 13375 | } |
| 13376 | } |
| 13377 | |
| 13378 | /* End of Outputs for SubSystem: '<S631>/PosRapidUpdate_1' */ |
| 13379 | |
| 13380 | /* Switch: '<S631>/Switch' */ |
| 13381 | if (L4_MABX_B.If_Then_Else.Switch) { |
| 13382 | L4_MABX_B.Latitude_ = L4_MABX_B.SFunction1_o1_bh; |
| 13383 | L4_MABX_B.Longitude_ = L4_MABX_B.SFunction1_o2_db; |
| 13384 | } else { |
| 13385 | L4_MABX_B.Latitude_ = L4_MABX_B.SFunction1_o1_ju; |
| 13386 | L4_MABX_B.Longitude_ = L4_MABX_B.SFunction1_o2_aq; |
| 13387 | } |
| 13388 | |
| 13389 | /* Outputs for Enabled SubSystem: '<S511>/CCVS1_00' incorporates: |
| 13390 | * EnablePort: '<S512>/Enable' |
| 13391 | */ |
| 13392 | /* Constant: '<S435>/Constant' */ |
| 13393 | if (L4_MABX_P.Constant_Value_d2) { |
| 13394 | /* S-Function (rti_commonblock): '<S512>/S-Function1' */ |
| 13395 | /* This comment workarounds a code generation problem */ |
| 13396 | |
| 13397 | /* dSPACE RTICAN RX Message Block: "CCVS1_00" Id:218034432 */ |
| 13398 | { |
| 13399 | UInt32 *CAN_Msg; |
| 13400 | static dsfloat time_old = 0.0; |
| 13401 | |
| 13402 | /* Read status and timestamp info (previous message) */ |
| 13403 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCFEF100].timestamp != |
| 13404 | time_old) { |
| 13405 | /* ... save timestamp info for the calculation of the RX status |
| 13406 | during the consecutive sample hit*/ |
| 13407 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCFEF100]. |
| 13408 | timestamp; |
| 13409 | |
| 13410 | /* ... set the processed flag to one */ |
| 13411 | L4_MABX_B.SFunction1_o21_j = 1.0; |
| 13412 | L4_MABX_B.SFunction1_o22_oy = (real_T) |
| 13413 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCFEF100].timestamp; |
| 13414 | L4_MABX_B.SFunction1_o23_o = (real_T) |
| 13415 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCFEF100].deltatime; |
| 13416 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCFEF100].data; |
| 13417 | |
| 13418 | /* Decode CAN message */ |
| 13419 | { |
| 13420 | { |
| 13421 | rtican_Signal_t CAN_Sgn; |
| 13422 | |
| 13423 | /* ...... "TwoSpeedAxleSwitch" (0|2, standard signal, unsigned int, little endian) */ |
| 13424 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 13425 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13426 | L4_MABX_B.SFunction1_o1_g3 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13427 | |
| 13428 | /* ...... "ParkingBrakeSwitch" (2|2, standard signal, unsigned int, little endian) */ |
| 13429 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 13430 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 13431 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13432 | L4_MABX_B.SFunction1_o2_g4 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13433 | |
| 13434 | /* ...... "CruiseCtrlPauseSwitch" (4|2, standard signal, unsigned int, little endian) */ |
| 13435 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 13436 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 13437 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13438 | L4_MABX_B.SFunction1_o3_ne = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13439 | |
| 13440 | /* ...... "ParkBrakeReleaseInhibitRq" (6|2, standard signal, unsigned int, little endian) */ |
| 13441 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 13442 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 13443 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13444 | L4_MABX_B.SFunction1_o4_e3 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13445 | |
| 13446 | /* ...... "WheelBasedVehicleSpeed" (8|16, standard signal, unsigned int, little endian) */ |
| 13447 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 13448 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 13449 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 13450 | WheelBasedVehicleSpeed = 0.00390625 * ( ((real_T) |
| 13451 | CAN_Sgn.UnsignedSgn) ); |
| 13452 | |
| 13453 | /* ...... "CruiseCtrlActive" (24|2, standard signal, unsigned int, little endian) */ |
| 13454 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 13455 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13456 | L4_MABX_B.SFunction1_o6_oc = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13457 | |
| 13458 | /* ...... "CruiseCtrlEnableSwitch" (26|2, standard signal, unsigned int, little endian) */ |
| 13459 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 13460 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 13461 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13462 | L4_MABX_B.SFunction1_o7_dk = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13463 | |
| 13464 | /* ...... "BrakeSwitch" (28|2, standard signal, unsigned int, little endian) */ |
| 13465 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 13466 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 13467 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13468 | BrakeSwitch = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13469 | |
| 13470 | /* ...... "ClutchSwitch" (30|2, standard signal, unsigned int, little endian) */ |
| 13471 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 13472 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 13473 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13474 | L4_MABX_B.SFunction1_o9_p = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13475 | |
| 13476 | /* ...... "CruiseCtrlSetSwitch" (32|2, standard signal, unsigned int, little endian) */ |
| 13477 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 13478 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13479 | L4_MABX_B.SFunction1_o10_or = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13480 | |
| 13481 | /* ...... "CruiseCtrlCoastSwitch" (34|2, standard signal, unsigned int, little endian) */ |
| 13482 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 13483 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 13484 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13485 | L4_MABX_B.SFunction1_o11_ae = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13486 | |
| 13487 | /* ...... "CruiseCtrlResumeSwitch" (36|2, standard signal, unsigned int, little endian) */ |
| 13488 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 13489 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 13490 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13491 | L4_MABX_B.SFunction1_o12_jy = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13492 | |
| 13493 | /* ...... "CruiseCtrlAccelerateSwitch" (38|2, standard signal, unsigned int, little endian) */ |
| 13494 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 13495 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 13496 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13497 | L4_MABX_B.SFunction1_o13_ou = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13498 | |
| 13499 | /* ...... "CruiseCtrlSetSpeed" (40|8, standard signal, unsigned int, little endian) */ |
| 13500 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 13501 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 13502 | L4_MABX_B.SFunction1_o14_b = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13503 | |
| 13504 | /* ...... "PTOGovernorState" (48|5, standard signal, unsigned int, little endian) */ |
| 13505 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 13506 | CAN_Sgn.UnsignedSgn &= 0x0000001F; |
| 13507 | L4_MABX_B.SFunction1_o15_dd = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13508 | |
| 13509 | /* ...... "CruiseCtrlStates" (53|3, standard signal, unsigned int, little endian) */ |
| 13510 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 13511 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 5; |
| 13512 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 13513 | L4_MABX_B.SFunction1_o16_g = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13514 | |
| 13515 | /* ...... "EngIdleIncrementSwitch" (56|2, standard signal, unsigned int, little endian) */ |
| 13516 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 13517 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13518 | L4_MABX_B.SFunction1_o17_n = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13519 | |
| 13520 | /* ...... "EngIdleDecrementSwitch" (58|2, standard signal, unsigned int, little endian) */ |
| 13521 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 13522 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 13523 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13524 | L4_MABX_B.SFunction1_o18_g = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13525 | |
| 13526 | /* ...... "EngTestModeSwitch" (60|2, standard signal, unsigned int, little endian) */ |
| 13527 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 13528 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 13529 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13530 | L4_MABX_B.SFunction1_o19_a = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13531 | |
| 13532 | /* ...... "EngShutdownOverrideSwitch" (62|2, standard signal, unsigned int, little endian) */ |
| 13533 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 13534 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 13535 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13536 | L4_MABX_B.SFunction1_o20_ir = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13537 | } |
| 13538 | } |
| 13539 | } else { |
| 13540 | /* set RX status to 0 because no new message has arrived */ |
| 13541 | L4_MABX_B.SFunction1_o21_j = 0.0; |
| 13542 | } |
| 13543 | } |
| 13544 | } |
| 13545 | |
| 13546 | /* End of Constant: '<S435>/Constant' */ |
| 13547 | /* End of Outputs for SubSystem: '<S511>/CCVS1_00' */ |
| 13548 | |
| 13549 | /* Outputs for Enabled SubSystem: '<S515>/COGSOGRapidUpdate_00' incorporates: |
| 13550 | * EnablePort: '<S516>/Enable' |
| 13551 | */ |
| 13552 | /* Constant: '<S437>/Constant' */ |
| 13553 | if (L4_MABX_P.Constant_Value_ky > 0.0) { |
| 13554 | /* S-Function (rti_commonblock): '<S516>/S-Function1' */ |
| 13555 | /* This comment workarounds a code generation problem */ |
| 13556 | |
| 13557 | /* dSPACE RTICAN RX Message Block: "COGSOGRapidUpdate_00" Id:167248384 */ |
| 13558 | { |
| 13559 | UInt32 *CAN_Msg; |
| 13560 | static dsfloat time_old = 0.0; |
| 13561 | |
| 13562 | /* Read status and timestamp info (previous message) */ |
| 13563 | if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80200].timestamp != |
| 13564 | time_old) { |
| 13565 | /* ... save timestamp info for the calculation of the RX status |
| 13566 | during the consecutive sample hit*/ |
| 13567 | time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80200]. |
| 13568 | timestamp; |
| 13569 | |
| 13570 | /* ... set the processed flag to one */ |
| 13571 | L4_MABX_B.SFunction1_o5_nx = 1.0; |
| 13572 | L4_MABX_B.SFunction1_o6_ez = (real_T) |
| 13573 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80200].timestamp; |
| 13574 | L4_MABX_B.SFunction1_o7_j = (real_T) |
| 13575 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80200].deltatime; |
| 13576 | CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80200].data; |
| 13577 | |
| 13578 | /* Decode CAN message */ |
| 13579 | { |
| 13580 | { |
| 13581 | rtican_Signal_t CAN_Sgn; |
| 13582 | |
| 13583 | /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */ |
| 13584 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 13585 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 13586 | L4_MABX_B.SFunction1_o1_nq = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13587 | |
| 13588 | /* ...... "COGReference" (8|2, standard signal, unsigned int, little endian) */ |
| 13589 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 13590 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13591 | L4_MABX_B.SFunction1_o2_co = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13592 | |
| 13593 | /* ...... "CourseOverGround" (16|16, standard signal, unsigned int, little endian) */ |
| 13594 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 13595 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 13596 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 13597 | L4_MABX_B.SFunction1_o3_at = 0.0001 * ( ((real_T) |
| 13598 | CAN_Sgn.UnsignedSgn) ); |
| 13599 | |
| 13600 | /* ...... "SpeedOverGround" (32|16, standard signal, unsigned int, little endian) */ |
| 13601 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 13602 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 13603 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 13604 | L4_MABX_B.SFunction1_o4_az = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 13605 | ); |
| 13606 | } |
| 13607 | } |
| 13608 | } else { |
| 13609 | /* set RX status to 0 because no new message has arrived */ |
| 13610 | L4_MABX_B.SFunction1_o5_nx = 0.0; |
| 13611 | } |
| 13612 | } |
| 13613 | } |
| 13614 | |
| 13615 | /* End of Outputs for SubSystem: '<S515>/COGSOGRapidUpdate_00' */ |
| 13616 | |
| 13617 | /* DataTypeConversion: '<S515>/Data Type Conversion8' */ |
| 13618 | L4_MABX_B.RX_status_e = (L4_MABX_B.SFunction1_o5_nx != 0.0); |
| 13619 | |
| 13620 | /* Outputs for Enabled SubSystem: '<S515>/COGSOGRapidUpdate_1' incorporates: |
| 13621 | * EnablePort: '<S517>/Enable' |
| 13622 | */ |
| 13623 | /* Constant: '<S437>/Constant' */ |
| 13624 | if (L4_MABX_P.Constant_Value_ky > 0.0) { |
| 13625 | /* S-Function (rti_commonblock): '<S517>/S-Function1' */ |
| 13626 | /* This comment workarounds a code generation problem */ |
| 13627 | |
| 13628 | /* dSPACE RTICAN RX Message Block: "COGSOGRapidUpdate_00" Id:167248385 */ |
| 13629 | { |
| 13630 | UInt32 *CAN_Msg; |
| 13631 | static dsfloat time_old = 0.0; |
| 13632 | |
| 13633 | /* Read status and timestamp info (previous message) */ |
| 13634 | if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80201].timestamp != |
| 13635 | time_old) { |
| 13636 | /* ... save timestamp info for the calculation of the RX status |
| 13637 | during the consecutive sample hit*/ |
| 13638 | time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80201]. |
| 13639 | timestamp; |
| 13640 | |
| 13641 | /* ... set the processed flag to one */ |
| 13642 | L4_MABX_B.SFunction1_o5_f1p = 1.0; |
| 13643 | L4_MABX_B.SFunction1_o6_f = (real_T) |
| 13644 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80201].timestamp; |
| 13645 | L4_MABX_B.SFunction1_o7_bu = (real_T) |
| 13646 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80201].deltatime; |
| 13647 | CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80201].data; |
| 13648 | |
| 13649 | /* Decode CAN message */ |
| 13650 | { |
| 13651 | { |
| 13652 | rtican_Signal_t CAN_Sgn; |
| 13653 | |
| 13654 | /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */ |
| 13655 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 13656 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 13657 | L4_MABX_B.SFunction1_o1_ar = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13658 | |
| 13659 | /* ...... "COGReference" (8|2, standard signal, unsigned int, little endian) */ |
| 13660 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 13661 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13662 | L4_MABX_B.SFunction1_o2_p0 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13663 | |
| 13664 | /* ...... "CourseOverGround" (16|16, standard signal, unsigned int, little endian) */ |
| 13665 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 13666 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 13667 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 13668 | L4_MABX_B.SFunction1_o3_adq = 0.0001 * ( ((real_T) |
| 13669 | CAN_Sgn.UnsignedSgn) ); |
| 13670 | |
| 13671 | /* ...... "SpeedOverGround" (32|16, standard signal, unsigned int, little endian) */ |
| 13672 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 13673 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 13674 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 13675 | L4_MABX_B.SFunction1_o4_gf = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 13676 | ); |
| 13677 | } |
| 13678 | } |
| 13679 | } else { |
| 13680 | /* set RX status to 0 because no new message has arrived */ |
| 13681 | L4_MABX_B.SFunction1_o5_f1p = 0.0; |
| 13682 | } |
| 13683 | } |
| 13684 | } |
| 13685 | |
| 13686 | /* End of Outputs for SubSystem: '<S515>/COGSOGRapidUpdate_1' */ |
| 13687 | |
| 13688 | /* Switch: '<S515>/Switch' */ |
| 13689 | if (L4_MABX_B.RX_status_e) { |
| 13690 | L4_MABX_B.SID = L4_MABX_B.SFunction1_o1_nq; |
| 13691 | L4_MABX_B.COGReference = L4_MABX_B.SFunction1_o2_co; |
| 13692 | L4_MABX_B.CourseOverGround = L4_MABX_B.SFunction1_o3_at; |
| 13693 | L4_MABX_B.SpeedOverGround = L4_MABX_B.SFunction1_o4_az; |
| 13694 | } else { |
| 13695 | L4_MABX_B.SID = L4_MABX_B.SFunction1_o1_ar; |
| 13696 | L4_MABX_B.COGReference = L4_MABX_B.SFunction1_o2_p0; |
| 13697 | L4_MABX_B.CourseOverGround = L4_MABX_B.SFunction1_o3_adq; |
| 13698 | L4_MABX_B.SpeedOverGround = L4_MABX_B.SFunction1_o4_gf; |
| 13699 | } |
| 13700 | |
| 13701 | /* Outputs for Atomic SubSystem: '<S855>/CAN_TX_100ms' */ |
| 13702 | |
| 13703 | /* RateTransition: '<S892>/TmpRTBAtHiddenBuf_InsertedFor_Rolling_15_counter_at_inport_0Inport1' */ |
| 13704 | if (L4_MABX_M->Timing.RateInteraction.TID0_3 == 1) { |
| 13705 | L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_R = AutonomousOutputEnabled; |
| 13706 | |
| 13707 | /* RateTransition: '<S910>/TmpRTBAtOperatorInport1' */ |
| 13708 | L4_MABX_B.TmpRTBAtOperatorInport1 = AutonomousOutputEnabled; |
| 13709 | |
| 13710 | /* RateTransition: '<S913>/TmpRTBAtOperatorInport1' */ |
| 13711 | L4_MABX_B.TmpRTBAtOperatorInport1_c = AutonomousOutputEnabled; |
| 13712 | |
| 13713 | /* RateTransition: '<S904>/TmpRTBAtOperatorInport1' */ |
| 13714 | L4_MABX_B.TmpRTBAtOperatorInport1_n = AutonomousOutputEnabled; |
| 13715 | |
| 13716 | /* RateTransition: '<S905>/TmpRTBAtOperatorInport1' */ |
| 13717 | L4_MABX_B.TmpRTBAtOperatorInport1_k = AutonomousOutputEnabled; |
| 13718 | |
| 13719 | /* RateTransition: '<S911>/TmpRTBAtOperatorInport1' */ |
| 13720 | L4_MABX_B.TmpRTBAtOperatorInport1_kn = AutonomousOutputEnabled; |
| 13721 | |
| 13722 | /* RateTransition: '<S912>/TmpRTBAtOperatorInport1' */ |
| 13723 | L4_MABX_B.TmpRTBAtOperatorInport1_cw = AutonomousOutputEnabled; |
| 13724 | L4_MABX_B.Latitude__m = L4_MABX_B.Latitude_; |
| 13725 | L4_MABX_B.Longitude__a = L4_MABX_B.Longitude_; |
| 13726 | L4_MABX_B.TwoSpeedAxleSwitch_a = L4_MABX_B.SFunction1_o1_g3; |
| 13727 | L4_MABX_B.ParkingBrakeSwitch_m = L4_MABX_B.SFunction1_o2_g4; |
| 13728 | L4_MABX_B.CruiseCtrlPauseSwitch_e = L4_MABX_B.SFunction1_o3_ne; |
| 13729 | L4_MABX_B.ParkBrakeReleaseInhibitRq_n = L4_MABX_B.SFunction1_o4_e3; |
| 13730 | L4_MABX_B.WheelBasedVehicleSpeed_pj = WheelBasedVehicleSpeed; |
| 13731 | L4_MABX_B.CruiseCtrlActive_i = L4_MABX_B.SFunction1_o6_oc; |
| 13732 | L4_MABX_B.CruiseCtrlEnableSwitch_n3 = L4_MABX_B.SFunction1_o7_dk; |
| 13733 | L4_MABX_B.BrakeSwitch_n4 = BrakeSwitch; |
| 13734 | L4_MABX_B.ClutchSwitch_l = L4_MABX_B.SFunction1_o9_p; |
| 13735 | L4_MABX_B.CruiseCtrlSetSwitch_h = L4_MABX_B.SFunction1_o10_or; |
| 13736 | L4_MABX_B.CruiseCtrlCoastSwitch_c = L4_MABX_B.SFunction1_o11_ae; |
| 13737 | L4_MABX_B.CruiseCtrlResumeSwitch_b = L4_MABX_B.SFunction1_o12_jy; |
| 13738 | L4_MABX_B.CruiseCtrlAccelerateSwitch_c = L4_MABX_B.SFunction1_o13_ou; |
| 13739 | L4_MABX_B.CruiseCtrlSetSpeed_m = L4_MABX_B.SFunction1_o14_b; |
| 13740 | L4_MABX_B.PTOGovernorState_c = L4_MABX_B.SFunction1_o15_dd; |
| 13741 | L4_MABX_B.CruiseCtrlStates_k = L4_MABX_B.SFunction1_o16_g; |
| 13742 | L4_MABX_B.EngIdleIncrementSwitch_f = L4_MABX_B.SFunction1_o17_n; |
| 13743 | L4_MABX_B.EngIdleDecrementSwitch_i = L4_MABX_B.SFunction1_o18_g; |
| 13744 | L4_MABX_B.EngTestModeSwitch_d = L4_MABX_B.SFunction1_o19_a; |
| 13745 | L4_MABX_B.EngShutdownOverrideSwitch_p = L4_MABX_B.SFunction1_o20_ir; |
| 13746 | L4_MABX_B.TwoSpeedAxleSwitch_ay = L4_MABX_B.SFunction1_o1_g3; |
| 13747 | L4_MABX_B.ParkingBrakeSwitch_md = L4_MABX_B.SFunction1_o2_g4; |
| 13748 | L4_MABX_B.CruiseCtrlPauseSwitch_eq = L4_MABX_B.SFunction1_o3_ne; |
| 13749 | L4_MABX_B.ParkBrakeReleaseInhibitRq_n0 = L4_MABX_B.SFunction1_o4_e3; |
| 13750 | L4_MABX_B.WheelBasedVehicleSpeed_pjm = WheelBasedVehicleSpeed; |
| 13751 | L4_MABX_B.CruiseCtrlActive_iq = L4_MABX_B.SFunction1_o6_oc; |
| 13752 | L4_MABX_B.CruiseCtrlEnableSwitch_n3b = L4_MABX_B.SFunction1_o7_dk; |
| 13753 | L4_MABX_B.BrakeSwitch_n4h = BrakeSwitch; |
| 13754 | L4_MABX_B.ClutchSwitch_lp = L4_MABX_B.SFunction1_o9_p; |
| 13755 | L4_MABX_B.CruiseCtrlSetSwitch_hj = L4_MABX_B.SFunction1_o10_or; |
| 13756 | L4_MABX_B.CruiseCtrlCoastSwitch_cs = L4_MABX_B.SFunction1_o11_ae; |
| 13757 | L4_MABX_B.CruiseCtrlResumeSwitch_b4 = L4_MABX_B.SFunction1_o12_jy; |
| 13758 | L4_MABX_B.CruiseCtrlAccelerateSwitch_ci = L4_MABX_B.SFunction1_o13_ou; |
| 13759 | L4_MABX_B.CruiseCtrlSetSpeed_mm = L4_MABX_B.SFunction1_o14_b; |
| 13760 | L4_MABX_B.PTOGovernorState_cv = L4_MABX_B.SFunction1_o15_dd; |
| 13761 | L4_MABX_B.CruiseCtrlStates_ks = L4_MABX_B.SFunction1_o16_g; |
| 13762 | L4_MABX_B.EngIdleIncrementSwitch_f1 = L4_MABX_B.SFunction1_o17_n; |
| 13763 | L4_MABX_B.EngIdleDecrementSwitch_il = L4_MABX_B.SFunction1_o18_g; |
| 13764 | L4_MABX_B.EngTestModeSwitch_d0 = L4_MABX_B.SFunction1_o19_a; |
| 13765 | L4_MABX_B.EngShutdownOverrideSwitch_pi = L4_MABX_B.SFunction1_o20_ir; |
| 13766 | L4_MABX_B.SID_i = L4_MABX_B.SID; |
| 13767 | L4_MABX_B.COGReference_f = L4_MABX_B.COGReference; |
| 13768 | L4_MABX_B.CourseOverGround_f = L4_MABX_B.CourseOverGround; |
| 13769 | L4_MABX_B.SpeedOverGround_b = L4_MABX_B.SpeedOverGround; |
| 13770 | L4_MABX_B.ASREngCtrlActive = L4_MABX_B.SFunction1_o1_df; |
| 13771 | L4_MABX_B.ASRBrakeCtrlActive = L4_MABX_B.SFunction1_o2_eb; |
| 13772 | L4_MABX_B.AntiLockBrakingActive = L4_MABX_B.SFunction1_o3_kb; |
| 13773 | L4_MABX_B.EBSBrakeSwitch_j = L4_MABX_B.SFunction1_o4_nj; |
| 13774 | L4_MABX_B.BrakePedalPos = L4_MABX_B.SFunction1_o5_k3; |
| 13775 | L4_MABX_B.ABSOffroadSwitch = L4_MABX_B.SFunction1_o6_hu; |
| 13776 | L4_MABX_B.ASROffroadSwitch = L4_MABX_B.SFunction1_o7_k; |
| 13777 | L4_MABX_B.ASRHillHolderSwitch = L4_MABX_B.SFunction1_o8_lb; |
| 13778 | L4_MABX_B.TractionCtrlOverrideSwitch = L4_MABX_B.SFunction1_o9_oz; |
| 13779 | L4_MABX_B.AccelInterlockSwitch = L4_MABX_B.SFunction1_o10_dd; |
| 13780 | L4_MABX_B.EngDerateSwitch = L4_MABX_B.SFunction1_o11_a2; |
| 13781 | L4_MABX_B.EngAuxShutdownSwitch = L4_MABX_B.SFunction1_o12_c; |
| 13782 | L4_MABX_B.RemoteAccelEnableSwitch = L4_MABX_B.SFunction1_o13_o; |
| 13783 | L4_MABX_B.EngRetarderSelection = L4_MABX_B.SFunction1_o14_l; |
| 13784 | L4_MABX_B.ABSFullyOperational = L4_MABX_B.SFunction1_o15_a; |
| 13785 | L4_MABX_B.EBSRedWarningSignal = L4_MABX_B.SFunction1_o16_ed; |
| 13786 | L4_MABX_B.ABS_EBSAmberWarningSignal = L4_MABX_B.SFunction1_o17_d; |
| 13787 | L4_MABX_B.ATC_ASRInformationSignal = L4_MABX_B.SFunction1_o18_c; |
| 13788 | L4_MABX_B.SrcAddrssOfCtrllngDvcFrBrkCntrl = L4_MABX_B.SFunction1_o19_o; |
| 13789 | L4_MABX_B.HaltBrakeSwitch = L4_MABX_B.SFunction1_o20_e; |
| 13790 | L4_MABX_B.TrailerABSStatus = L4_MABX_B.SFunction1_o21_f; |
| 13791 | L4_MABX_B.TrctrMntdTrilerABSWarningSignal = L4_MABX_B.SFunction1_o22_o; |
| 13792 | } |
| 13793 | |
| 13794 | /* End of Outputs for SubSystem: '<S855>/CAN_TX_100ms' */ |
| 13795 | |
| 13796 | /* Outputs for Atomic SubSystem: '<S855>/CAN_TX_10ms' */ |
| 13797 | |
| 13798 | /* DataTypeConversion: '<S957>/Data Type Conversion4' */ |
| 13799 | L4_MABX_B.DataTypeConversion4_d = L4_MABX_B.Diff; |
| 13800 | |
| 13801 | /* DataTypeConversion: '<S946>/Data Type Conversion' incorporates: |
| 13802 | * Constant: '<S860>/CANT_ACCS_E4_CHANNEL_APV' |
| 13803 | */ |
| 13804 | L4_MABX_B.DataTypeConversion_cs = (uint8_T) |
| 13805 | L4_MABX_P.CANT_ACCS_E4_CHANNEL_APV_Value; |
| 13806 | |
| 13807 | /* S-Function (sfix_bitop): '<S954>/Operator' */ |
| 13808 | L4_MABX_B.Operator_n0 = (uint8_T)(L4_MABX_B.DataTypeConversion_cs & |
| 13809 | L4_MABX_P.Operator_BitMask_i5); |
| 13810 | |
| 13811 | /* DataTypeConversion: '<S954>/DataType' */ |
| 13812 | L4_MABX_B.DataType_ik = L4_MABX_B.Operator_n0; |
| 13813 | |
| 13814 | /* ArithShift: '<S946>/Shift_Arithmetic 2' */ |
| 13815 | L4_MABX_B.Shift_Arithmetic2_i = ldexp(L4_MABX_B.DataType_ik, (-3)); |
| 13816 | |
| 13817 | /* DataTypeConversion: '<S946>/Data Type Conversion5' */ |
| 13818 | L4_MABX_B.DataTypeConversion5_a = (L4_MABX_B.Shift_Arithmetic2_i != 0.0); |
| 13819 | |
| 13820 | /* Outputs for Enabled SubSystem: '<S957>/ACCS' incorporates: |
| 13821 | * EnablePort: '<S958>/Enable' |
| 13822 | */ |
| 13823 | if (L4_MABX_B.DataTypeConversion5_a) { |
| 13824 | /* S-Function (rti_commonblock): '<S958>/S-Function1' */ |
| 13825 | /* This comment workarounds a code generation problem */ |
| 13826 | |
| 13827 | /* dSPACE RTICAN TX Message Block: "ACCS" Id:418393572 */ |
| 13828 | { |
| 13829 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 13830 | |
| 13831 | Float32 delayTime = 0.0; |
| 13832 | |
| 13833 | /* ... Read status and timestamp info (previous message) */ |
| 13834 | can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]); |
| 13835 | |
| 13836 | /* Convert timestamp */ |
| 13837 | if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->processed) { |
| 13838 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->timestamp = |
| 13839 | rtk_dsts_time_to_simtime_convert |
| 13840 | (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->timestamp); |
| 13841 | } |
| 13842 | |
| 13843 | /* Messages with timestamp zero have been received in pause/stop state |
| 13844 | and must not be handled. |
| 13845 | */ |
| 13846 | if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->timestamp > 0.0) { |
| 13847 | L4_MABX_B.SFunction1_o1_h = (real_T) |
| 13848 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->processed; |
| 13849 | L4_MABX_B.SFunction1_o2_j = (real_T) |
| 13850 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->timestamp; |
| 13851 | L4_MABX_B.SFunction1_o3_br = (real_T) |
| 13852 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->deltatime; |
| 13853 | L4_MABX_B.SFunction1_o4_d = (real_T) |
| 13854 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->delaytime; |
| 13855 | } |
| 13856 | |
| 13857 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 13858 | { |
| 13859 | rtican_Signal_t CAN_Sgn; |
| 13860 | |
| 13861 | /* ...... "LongitudinalAccelerationExRange" (16|16, standard signal, unsigned int, little endian) */ |
| 13862 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13863 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion4_d - |
| 13864 | ( -320 ) ) / 0.01 + 0.5); |
| 13865 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 13866 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 13867 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte1; |
| 13868 | } |
| 13869 | |
| 13870 | /* mask unused bits with '1' */ |
| 13871 | CAN_Msg[0] |= 0xFF; |
| 13872 | CAN_Msg[1] |= 0xFF; |
| 13873 | CAN_Msg[4] |= 0xFF; |
| 13874 | CAN_Msg[5] |= 0xFF; |
| 13875 | CAN_Msg[6] |= 0xFF; |
| 13876 | CAN_Msg[7] |= 0xFF; |
| 13877 | |
| 13878 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 13879 | can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4], 8, |
| 13880 | &(CAN_Msg[0]), delayTime); |
| 13881 | } |
| 13882 | } |
| 13883 | |
| 13884 | /* End of Outputs for SubSystem: '<S957>/ACCS' */ |
| 13885 | |
| 13886 | /* S-Function (sfix_bitop): '<S951>/Operator' */ |
| 13887 | L4_MABX_B.Operator_os = (uint8_T)(L4_MABX_B.DataTypeConversion_cs & |
| 13888 | L4_MABX_P.Operator_BitMask_co); |
| 13889 | |
| 13890 | /* DataTypeConversion: '<S951>/DataType' */ |
| 13891 | L4_MABX_B.DataType_ko = L4_MABX_B.Operator_os; |
| 13892 | |
| 13893 | /* S-Function (sfix_bitop): '<S952>/Operator' */ |
| 13894 | L4_MABX_B.Operator_dt = (uint8_T)(L4_MABX_B.DataTypeConversion_cs & |
| 13895 | L4_MABX_P.Operator_BitMask_bi); |
| 13896 | |
| 13897 | /* DataTypeConversion: '<S952>/DataType' */ |
| 13898 | L4_MABX_B.DataType_j = L4_MABX_B.Operator_dt; |
| 13899 | |
| 13900 | /* S-Function (sfix_bitop): '<S953>/Operator' */ |
| 13901 | L4_MABX_B.Operator_g5 = (uint8_T)(L4_MABX_B.DataTypeConversion_cs & |
| 13902 | L4_MABX_P.Operator_BitMask_dt); |
| 13903 | |
| 13904 | /* DataTypeConversion: '<S953>/DataType' */ |
| 13905 | L4_MABX_B.DataType_a = L4_MABX_B.Operator_g5; |
| 13906 | |
| 13907 | /* S-Function (sfix_bitop): '<S955>/Operator' */ |
| 13908 | L4_MABX_B.Operator_ce = (uint8_T)(L4_MABX_B.DataTypeConversion_cs & |
| 13909 | L4_MABX_P.Operator_BitMask_kk); |
| 13910 | |
| 13911 | /* DataTypeConversion: '<S955>/DataType' */ |
| 13912 | L4_MABX_B.DataType_d = L4_MABX_B.Operator_ce; |
| 13913 | |
| 13914 | /* S-Function (sfix_bitop): '<S956>/Operator' */ |
| 13915 | L4_MABX_B.Operator_er = (uint8_T)(L4_MABX_B.DataTypeConversion_cs & |
| 13916 | L4_MABX_P.Operator_BitMask_od); |
| 13917 | |
| 13918 | /* DataTypeConversion: '<S956>/DataType' */ |
| 13919 | L4_MABX_B.DataType_g = L4_MABX_B.Operator_er; |
| 13920 | |
| 13921 | /* DataTypeConversion: '<S946>/Data Type Conversion2' */ |
| 13922 | L4_MABX_B.DataTypeConversion2_bm = (L4_MABX_B.DataType_ko != 0); |
| 13923 | |
| 13924 | /* ArithShift: '<S946>/Shift_Arithmetic ' */ |
| 13925 | L4_MABX_B.Shift_Arithmetic_m = ldexp(L4_MABX_B.DataType_j, (-1)); |
| 13926 | |
| 13927 | /* DataTypeConversion: '<S946>/Data Type Conversion3' */ |
| 13928 | L4_MABX_B.DataTypeConversion3_dv = (L4_MABX_B.Shift_Arithmetic_m != 0.0); |
| 13929 | |
| 13930 | /* ArithShift: '<S946>/Shift_Arithmetic 1' */ |
| 13931 | L4_MABX_B.Shift_Arithmetic1_o = ldexp(L4_MABX_B.DataType_a, (-2)); |
| 13932 | |
| 13933 | /* DataTypeConversion: '<S946>/Data Type Conversion4' */ |
| 13934 | L4_MABX_B.DataTypeConversion4_l1 = (L4_MABX_B.Shift_Arithmetic1_o != 0.0); |
| 13935 | |
| 13936 | /* ArithShift: '<S946>/Shift_Arithmetic 3' */ |
| 13937 | L4_MABX_B.Shift_Arithmetic3_d = ldexp(L4_MABX_B.DataType_d, (-4)); |
| 13938 | |
| 13939 | /* DataTypeConversion: '<S946>/Data Type Conversion6' */ |
| 13940 | L4_MABX_B.DataTypeConversion6_hi = (L4_MABX_B.Shift_Arithmetic3_d != 0.0); |
| 13941 | |
| 13942 | /* ArithShift: '<S946>/Shift_Arithmetic 4' */ |
| 13943 | L4_MABX_B.Shift_Arithmetic4_k = ldexp(L4_MABX_B.DataType_g, (-5)); |
| 13944 | |
| 13945 | /* DataTypeConversion: '<S946>/Data Type Conversion7' */ |
| 13946 | L4_MABX_B.DataTypeConversion7_ce = (L4_MABX_B.Shift_Arithmetic4_k != 0.0); |
| 13947 | |
| 13948 | /* DataTypeConversion: '<S965>/Data Type Conversion1' */ |
| 13949 | L4_MABX_B.DataTypeConversion1_me = L4_MABX_B.SFunction1_o2_dgu; |
| 13950 | |
| 13951 | /* DataTypeConversion: '<S965>/Data Type Conversion2' */ |
| 13952 | L4_MABX_B.DataTypeConversion2_d = L4_MABX_B.SFunction1_o3_ho; |
| 13953 | |
| 13954 | /* DataTypeConversion: '<S965>/Data Type Conversion3' */ |
| 13955 | L4_MABX_B.DataTypeConversion3_jg = L4_MABX_B.SFunction1_o4_ki; |
| 13956 | |
| 13957 | /* DataTypeConversion: '<S965>/Data Type Conversion4' */ |
| 13958 | L4_MABX_B.DataTypeConversion4_j = L4_MABX_B.SFunction1_o1_nr; |
| 13959 | |
| 13960 | /* DataTypeConversion: '<S965>/Data Type Conversion5' */ |
| 13961 | L4_MABX_B.DataTypeConversion5_l = L4_MABX_B.SFunction1_o5_nl; |
| 13962 | |
| 13963 | /* DataTypeConversion: '<S965>/Data Type Conversion6' */ |
| 13964 | L4_MABX_B.DataTypeConversion6_c = L4_MABX_B.SFunction1_o6_hc; |
| 13965 | |
| 13966 | /* DataTypeConversion: '<S965>/Data Type Conversion7' */ |
| 13967 | L4_MABX_B.DataTypeConversion7_e = L4_MABX_B.SFunction1_o7_ln; |
| 13968 | |
| 13969 | /* DataTypeConversion: '<S965>/Data Type Conversion8' */ |
| 13970 | L4_MABX_B.DataTypeConversion8_a = L4_MABX_B.SFunction1_o8_f; |
| 13971 | |
| 13972 | /* DataTypeConversion: '<S947>/Data Type Conversion' incorporates: |
| 13973 | * Constant: '<S860>/CANT_EEC1_00_CHANNEL_APV' |
| 13974 | */ |
| 13975 | L4_MABX_B.DataTypeConversion_jn = (uint8_T) |
| 13976 | L4_MABX_P.CANT_EEC1_00_CHANNEL_APV_Value; |
| 13977 | |
| 13978 | /* S-Function (sfix_bitop): '<S962>/Operator' */ |
| 13979 | L4_MABX_B.Operator_k1 = (uint8_T)(L4_MABX_B.DataTypeConversion_jn & |
| 13980 | L4_MABX_P.Operator_BitMask_cr); |
| 13981 | |
| 13982 | /* DataTypeConversion: '<S962>/DataType' */ |
| 13983 | L4_MABX_B.DataType_el = L4_MABX_B.Operator_k1; |
| 13984 | |
| 13985 | /* ArithShift: '<S947>/Shift_Arithmetic 2' */ |
| 13986 | L4_MABX_B.Shift_Arithmetic2_n = ldexp(L4_MABX_B.DataType_el, (-3)); |
| 13987 | |
| 13988 | /* DataTypeConversion: '<S947>/Data Type Conversion5' */ |
| 13989 | L4_MABX_B.DataTypeConversion5_m1 = (L4_MABX_B.Shift_Arithmetic2_n != 0.0); |
| 13990 | |
| 13991 | /* Outputs for Enabled SubSystem: '<S965>/EEC1_00' incorporates: |
| 13992 | * EnablePort: '<S967>/Enable' |
| 13993 | */ |
| 13994 | if (L4_MABX_B.DataTypeConversion5_m1) { |
| 13995 | /* S-Function (rti_commonblock): '<S967>/S-Function1' */ |
| 13996 | /* This comment workarounds a code generation problem */ |
| 13997 | |
| 13998 | /* dSPACE RTICAN TX Message Block: "EEC1_00" Id:217056256 */ |
| 13999 | { |
| 14000 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 14001 | |
| 14002 | Float32 delayTime = 0.0; |
| 14003 | |
| 14004 | /* ... Read status and timestamp info (previous message) */ |
| 14005 | can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]); |
| 14006 | |
| 14007 | /* Convert timestamp */ |
| 14008 | if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->processed) { |
| 14009 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->timestamp = |
| 14010 | rtk_dsts_time_to_simtime_convert |
| 14011 | (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->timestamp); |
| 14012 | } |
| 14013 | |
| 14014 | /* Messages with timestamp zero have been received in pause/stop state |
| 14015 | and must not be handled. |
| 14016 | */ |
| 14017 | if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->timestamp > 0.0) { |
| 14018 | L4_MABX_B.SFunction1_o1_kl = (real_T) |
| 14019 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->processed; |
| 14020 | L4_MABX_B.SFunction1_o2_o = (real_T) |
| 14021 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->timestamp; |
| 14022 | L4_MABX_B.SFunction1_o3_bv = (real_T) |
| 14023 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->deltatime; |
| 14024 | L4_MABX_B.SFunction1_o4_e5 = (real_T) |
| 14025 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->delaytime; |
| 14026 | } |
| 14027 | |
| 14028 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 14029 | { |
| 14030 | rtican_Signal_t CAN_Sgn; |
| 14031 | |
| 14032 | /* ...... "SPN899_EngineTorqueMode" (0|4, standard signal, unsigned int, little endian) */ |
| 14033 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14034 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion4_j ) + |
| 14035 | 0.5); |
| 14036 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 14037 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 14038 | |
| 14039 | /* ...... "SPN4154_ActEngPercTorqueFrac" (4|4, standard signal, unsigned int, little endian) */ |
| 14040 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14041 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_me - ( 0 |
| 14042 | ) ) / 0.125 + 0.5); |
| 14043 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 14044 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 14045 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 14046 | |
| 14047 | /* ...... "SPN512_DrvrDemEngPercTrq" (8|8, standard signal, unsigned int, little endian) */ |
| 14048 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14049 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion2_d - ( -125 |
| 14050 | ) + 0.5); |
| 14051 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14052 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 14053 | |
| 14054 | /* ...... "SPN513_ActEngPercTorque" (16|8, standard signal, unsigned int, little endian) */ |
| 14055 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14056 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion3_jg - |
| 14057 | ( -125 ) + 0.5); |
| 14058 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14059 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 14060 | |
| 14061 | /* ...... "SPN190_EngineSpeed" (24|16, standard signal, unsigned int, little endian) */ |
| 14062 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14063 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion5_l - ( 0 ) |
| 14064 | ) / 0.125 + 0.5); |
| 14065 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 14066 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 14067 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte1; |
| 14068 | |
| 14069 | /* ...... "SPN1483_SAOfCtrlDevForEngineCtrl" (40|8, standard signal, unsigned int, little endian) */ |
| 14070 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14071 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion6_c ) + |
| 14072 | 0.5); |
| 14073 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14074 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 14075 | |
| 14076 | /* ...... "SPN1675_EngineStarterMode" (48|4, standard signal, unsigned int, little endian) */ |
| 14077 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14078 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion7_e ) + |
| 14079 | 0.5); |
| 14080 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 14081 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 14082 | |
| 14083 | /* ...... "SPN2432_EngDemPercTrq" (56|8, standard signal, unsigned int, little endian) */ |
| 14084 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14085 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion8_a - ( -125 |
| 14086 | ) + 0.5); |
| 14087 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14088 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 14089 | } |
| 14090 | |
| 14091 | /* mask unused bits with '1' */ |
| 14092 | CAN_Msg[6] |= 0xF0; |
| 14093 | |
| 14094 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 14095 | can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400], 8, |
| 14096 | &(CAN_Msg[0]), delayTime); |
| 14097 | } |
| 14098 | } |
| 14099 | |
| 14100 | /* End of Outputs for SubSystem: '<S965>/EEC1_00' */ |
| 14101 | |
| 14102 | /* DataTypeConversion: '<S966>/Data Type Conversion1' */ |
| 14103 | L4_MABX_B.DataTypeConversion1_o1 = L4_MABX_B.SFunction1_o2_dgu; |
| 14104 | |
| 14105 | /* DataTypeConversion: '<S966>/Data Type Conversion2' */ |
| 14106 | L4_MABX_B.DataTypeConversion2_eq = L4_MABX_B.SFunction1_o3_ho; |
| 14107 | |
| 14108 | /* DataTypeConversion: '<S966>/Data Type Conversion3' */ |
| 14109 | L4_MABX_B.DataTypeConversion3_e = L4_MABX_B.SFunction1_o4_ki; |
| 14110 | |
| 14111 | /* DataTypeConversion: '<S966>/Data Type Conversion4' */ |
| 14112 | L4_MABX_B.DataTypeConversion4_g = L4_MABX_B.SFunction1_o1_nr; |
| 14113 | |
| 14114 | /* DataTypeConversion: '<S966>/Data Type Conversion5' */ |
| 14115 | L4_MABX_B.DataTypeConversion5_p = L4_MABX_B.SFunction1_o5_nl; |
| 14116 | |
| 14117 | /* DataTypeConversion: '<S966>/Data Type Conversion6' */ |
| 14118 | L4_MABX_B.DataTypeConversion6_h = L4_MABX_B.SFunction1_o6_hc; |
| 14119 | |
| 14120 | /* DataTypeConversion: '<S966>/Data Type Conversion7' */ |
| 14121 | L4_MABX_B.DataTypeConversion7_j = L4_MABX_B.SFunction1_o7_ln; |
| 14122 | |
| 14123 | /* DataTypeConversion: '<S966>/Data Type Conversion8' */ |
| 14124 | L4_MABX_B.DataTypeConversion8_h = L4_MABX_B.SFunction1_o8_f; |
| 14125 | |
| 14126 | /* S-Function (sfix_bitop): '<S963>/Operator' */ |
| 14127 | L4_MABX_B.Operator_bl = (uint8_T)(L4_MABX_B.DataTypeConversion_jn & |
| 14128 | L4_MABX_P.Operator_BitMask_kf); |
| 14129 | |
| 14130 | /* DataTypeConversion: '<S963>/DataType' */ |
| 14131 | L4_MABX_B.DataType_ix = L4_MABX_B.Operator_bl; |
| 14132 | |
| 14133 | /* ArithShift: '<S947>/Shift_Arithmetic 3' */ |
| 14134 | L4_MABX_B.Shift_Arithmetic3_e = ldexp(L4_MABX_B.DataType_ix, (-4)); |
| 14135 | |
| 14136 | /* DataTypeConversion: '<S947>/Data Type Conversion6' */ |
| 14137 | L4_MABX_B.DataTypeConversion6_gn = (L4_MABX_B.Shift_Arithmetic3_e != 0.0); |
| 14138 | |
| 14139 | /* Outputs for Enabled SubSystem: '<S966>/EEC1_00' incorporates: |
| 14140 | * EnablePort: '<S968>/Enable' |
| 14141 | */ |
| 14142 | if (L4_MABX_B.DataTypeConversion6_gn) { |
| 14143 | /* S-Function (rti_commonblock): '<S968>/S-Function1' */ |
| 14144 | /* This comment workarounds a code generation problem */ |
| 14145 | |
| 14146 | /* dSPACE RTICAN TX Message Block: "EEC1_00" Id:217056256 */ |
| 14147 | { |
| 14148 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 14149 | |
| 14150 | Float32 delayTime = 0.0; |
| 14151 | |
| 14152 | /* ... Read status and timestamp info (previous message) */ |
| 14153 | can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]); |
| 14154 | |
| 14155 | /* Convert timestamp */ |
| 14156 | if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->processed) { |
| 14157 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->timestamp = |
| 14158 | rtk_dsts_time_to_simtime_convert |
| 14159 | (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->timestamp); |
| 14160 | } |
| 14161 | |
| 14162 | /* Messages with timestamp zero have been received in pause/stop state |
| 14163 | and must not be handled. |
| 14164 | */ |
| 14165 | if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->timestamp > 0.0) { |
| 14166 | L4_MABX_B.SFunction1_o1_la = (real_T) |
| 14167 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->processed; |
| 14168 | L4_MABX_B.SFunction1_o2_b = (real_T) |
| 14169 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->timestamp; |
| 14170 | L4_MABX_B.SFunction1_o3_i1 = (real_T) |
| 14171 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->deltatime; |
| 14172 | L4_MABX_B.SFunction1_o4_mk = (real_T) |
| 14173 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->delaytime; |
| 14174 | } |
| 14175 | |
| 14176 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 14177 | { |
| 14178 | rtican_Signal_t CAN_Sgn; |
| 14179 | |
| 14180 | /* ...... "SPN899_EngineTorqueMode" (0|4, standard signal, unsigned int, little endian) */ |
| 14181 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14182 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion4_g ) + |
| 14183 | 0.5); |
| 14184 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 14185 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 14186 | |
| 14187 | /* ...... "SPN4154_ActEngPercTorqueFrac" (4|4, standard signal, unsigned int, little endian) */ |
| 14188 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14189 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_o1 - ( 0 |
| 14190 | ) ) / 0.125 + 0.5); |
| 14191 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 14192 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 14193 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 14194 | |
| 14195 | /* ...... "SPN512_DrvrDemEngPercTrq" (8|8, standard signal, unsigned int, little endian) */ |
| 14196 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14197 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion2_eq - |
| 14198 | ( -125 ) + 0.5); |
| 14199 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14200 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 14201 | |
| 14202 | /* ...... "SPN513_ActEngPercTorque" (16|8, standard signal, unsigned int, little endian) */ |
| 14203 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14204 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion3_e - ( -125 |
| 14205 | ) + 0.5); |
| 14206 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14207 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 14208 | |
| 14209 | /* ...... "SPN190_EngineSpeed" (24|16, standard signal, unsigned int, little endian) */ |
| 14210 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14211 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion5_p - ( 0 ) |
| 14212 | ) / 0.125 + 0.5); |
| 14213 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 14214 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 14215 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte1; |
| 14216 | |
| 14217 | /* ...... "SPN1483_SAOfCtrlDevForEngineCtrl" (40|8, standard signal, unsigned int, little endian) */ |
| 14218 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14219 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion6_h ) + |
| 14220 | 0.5); |
| 14221 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14222 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 14223 | |
| 14224 | /* ...... "SPN1675_EngineStarterMode" (48|4, standard signal, unsigned int, little endian) */ |
| 14225 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14226 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion7_j ) + |
| 14227 | 0.5); |
| 14228 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 14229 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 14230 | |
| 14231 | /* ...... "SPN2432_EngDemPercTrq" (56|8, standard signal, unsigned int, little endian) */ |
| 14232 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14233 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion8_h - ( -125 |
| 14234 | ) + 0.5); |
| 14235 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14236 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 14237 | } |
| 14238 | |
| 14239 | /* mask unused bits with '1' */ |
| 14240 | CAN_Msg[6] |= 0xF0; |
| 14241 | |
| 14242 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 14243 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400], 8, |
| 14244 | &(CAN_Msg[0]), delayTime); |
| 14245 | } |
| 14246 | } |
| 14247 | |
| 14248 | /* End of Outputs for SubSystem: '<S966>/EEC1_00' */ |
| 14249 | |
| 14250 | /* S-Function (sfix_bitop): '<S959>/Operator' */ |
| 14251 | L4_MABX_B.Operator_ku = (uint8_T)(L4_MABX_B.DataTypeConversion_jn & |
| 14252 | L4_MABX_P.Operator_BitMask_am); |
| 14253 | |
| 14254 | /* DataTypeConversion: '<S959>/DataType' */ |
| 14255 | L4_MABX_B.DataType_cq = L4_MABX_B.Operator_ku; |
| 14256 | |
| 14257 | /* S-Function (sfix_bitop): '<S960>/Operator' */ |
| 14258 | L4_MABX_B.Operator_pu = (uint8_T)(L4_MABX_B.DataTypeConversion_jn & |
| 14259 | L4_MABX_P.Operator_BitMask_j); |
| 14260 | |
| 14261 | /* DataTypeConversion: '<S960>/DataType' */ |
| 14262 | L4_MABX_B.DataType_e0 = L4_MABX_B.Operator_pu; |
| 14263 | |
| 14264 | /* S-Function (sfix_bitop): '<S961>/Operator' */ |
| 14265 | L4_MABX_B.Operator_pn = (uint8_T)(L4_MABX_B.DataTypeConversion_jn & |
| 14266 | L4_MABX_P.Operator_BitMask_b3); |
| 14267 | |
| 14268 | /* DataTypeConversion: '<S961>/DataType' */ |
| 14269 | L4_MABX_B.DataType_p = L4_MABX_B.Operator_pn; |
| 14270 | |
| 14271 | /* S-Function (sfix_bitop): '<S964>/Operator' */ |
| 14272 | L4_MABX_B.Operator_fu = (uint8_T)(L4_MABX_B.DataTypeConversion_jn & |
| 14273 | L4_MABX_P.Operator_BitMask_ld); |
| 14274 | |
| 14275 | /* DataTypeConversion: '<S964>/DataType' */ |
| 14276 | L4_MABX_B.DataType_o = L4_MABX_B.Operator_fu; |
| 14277 | |
| 14278 | /* DataTypeConversion: '<S947>/Data Type Conversion2' */ |
| 14279 | L4_MABX_B.DataTypeConversion2_kq = (L4_MABX_B.DataType_cq != 0); |
| 14280 | |
| 14281 | /* ArithShift: '<S947>/Shift_Arithmetic ' */ |
| 14282 | L4_MABX_B.Shift_Arithmetic_f = ldexp(L4_MABX_B.DataType_e0, (-1)); |
| 14283 | |
| 14284 | /* DataTypeConversion: '<S947>/Data Type Conversion3' */ |
| 14285 | L4_MABX_B.DataTypeConversion3_d5 = (L4_MABX_B.Shift_Arithmetic_f != 0.0); |
| 14286 | |
| 14287 | /* ArithShift: '<S947>/Shift_Arithmetic 1' */ |
| 14288 | L4_MABX_B.Shift_Arithmetic1_g = ldexp(L4_MABX_B.DataType_p, (-2)); |
| 14289 | |
| 14290 | /* DataTypeConversion: '<S947>/Data Type Conversion4' */ |
| 14291 | L4_MABX_B.DataTypeConversion4_pe = (L4_MABX_B.Shift_Arithmetic1_g != 0.0); |
| 14292 | |
| 14293 | /* ArithShift: '<S947>/Shift_Arithmetic 4' */ |
| 14294 | L4_MABX_B.Shift_Arithmetic4_o = ldexp(L4_MABX_B.DataType_o, (-5)); |
| 14295 | |
| 14296 | /* DataTypeConversion: '<S947>/Data Type Conversion7' */ |
| 14297 | L4_MABX_B.DataTypeConversion7_hc = (L4_MABX_B.Shift_Arithmetic4_o != 0.0); |
| 14298 | |
| 14299 | /* DataTypeConversion: '<S950>/Data Type Conversion' */ |
| 14300 | L4_MABX_B.DataTypeConversion_hh = AutonomousOutputEnabled; |
| 14301 | |
| 14302 | /* Switch: '<S984>/Switch' incorporates: |
| 14303 | * Constant: '<S984>/Constant' |
| 14304 | * Constant: '<S984>/Constant1' |
| 14305 | */ |
| 14306 | if (L4_MABX_B.DataTypeConversion_hh != 0) { |
| 14307 | L4_MABX_B.Switch_jl = L4_MABX_P.Constant_Value_hq2; |
| 14308 | } else { |
| 14309 | L4_MABX_B.Switch_jl = L4_MABX_P.Constant1_Value_ei; |
| 14310 | } |
| 14311 | |
| 14312 | /* End of Switch: '<S984>/Switch' */ |
| 14313 | |
| 14314 | /* DataTypeConversion: '<S982>/Data Type Conversion' */ |
| 14315 | L4_MABX_B.DataTypeConversion_e3 = L4_MABX_B.Switch_jl; |
| 14316 | |
| 14317 | /* RelationalOperator: '<S1001>/Operator' incorporates: |
| 14318 | * Constant: '<S983>/Constant' |
| 14319 | * Constant: '<S983>/Constant6' |
| 14320 | */ |
| 14321 | L4_MABX_B.Operator_l5 = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV == |
| 14322 | L4_MABX_P.Constant_Value_dc); |
| 14323 | |
| 14324 | /* Outputs for Enabled SubSystem: '<S983>/DEFAULT_TRQ_CTRL_MODE' */ |
| 14325 | L4_MABX_ALL_CTRL_DISABLED(L4_MABX_B.Operator_l5, &L4_MABX_B.Merge, |
| 14326 | &L4_MABX_P.DEFAULT_TRQ_CTRL_MODE); |
| 14327 | |
| 14328 | /* End of Outputs for SubSystem: '<S983>/DEFAULT_TRQ_CTRL_MODE' */ |
| 14329 | |
| 14330 | /* Switch: '<S1000>/Switch' incorporates: |
| 14331 | * Constant: '<S1000>/zero' |
| 14332 | */ |
| 14333 | if (L4_MABX_B.DataTypeConversion_hh != 0) { |
| 14334 | /* MultiPortSwitch: '<S1000>/Multiport_Switch' incorporates: |
| 14335 | * Constant: '<S1000>/Constant1' |
| 14336 | * Constant: '<S1000>/Constant7' |
| 14337 | */ |
| 14338 | switch (PROPB_REAX_1_E4_DES_POS_SIG_SRC_APV) { |
| 14339 | case ENUM_STEERING_POS_SIGNAL_SOURCE_T_SW_EMULATION: |
| 14340 | L4_MABX_B.Multiport_Switch = PROPB_REAX_1_E4_DESIRED_POSITION_APV; |
| 14341 | break; |
| 14342 | |
| 14343 | case ENUM_STEERING_POS_SIGNAL_SOURCE_T_ESTIMATION: |
| 14344 | L4_MABX_B.Multiport_Switch = L4_MABX_B.Subtract_c1; |
| 14345 | break; |
| 14346 | |
| 14347 | default: |
| 14348 | L4_MABX_B.Multiport_Switch = PROPB_REAX_1_E4_DESIRED_POSITION_APV; |
| 14349 | break; |
| 14350 | } |
| 14351 | |
| 14352 | /* End of MultiPortSwitch: '<S1000>/Multiport_Switch' */ |
| 14353 | L4_MABX_B.Switch_i = L4_MABX_B.Multiport_Switch; |
| 14354 | } else { |
| 14355 | L4_MABX_B.Switch_i = L4_MABX_P.zero_Value_h; |
| 14356 | } |
| 14357 | |
| 14358 | /* End of Switch: '<S1000>/Switch' */ |
| 14359 | |
| 14360 | /* RelationalOperator: '<S1010>/Operator_MX' incorporates: |
| 14361 | * Constant: '<S1010>/MX' |
| 14362 | */ |
| 14363 | L4_MABX_B.Operator_MX = (L4_MABX_B.Switch_i > L4_MABX_P.MX_Value); |
| 14364 | |
| 14365 | /* RelationalOperator: '<S1010>/Operator_MN' incorporates: |
| 14366 | * Constant: '<S1010>/MN' |
| 14367 | */ |
| 14368 | L4_MABX_B.Operator_MN = (L4_MABX_B.Switch_i < L4_MABX_P.MN_Value); |
| 14369 | |
| 14370 | /* Switch: '<S1010>/Switch2' incorporates: |
| 14371 | * Constant: '<S1010>/MX' |
| 14372 | * Switch: '<S1010>/Switch1' |
| 14373 | */ |
| 14374 | if (L4_MABX_B.Operator_MX) { |
| 14375 | L4_MABX_B.Switch2 = L4_MABX_P.MX_Value; |
| 14376 | } else { |
| 14377 | if (L4_MABX_B.Operator_MN) { |
| 14378 | /* Switch: '<S1010>/Switch1' incorporates: |
| 14379 | * Constant: '<S1010>/MN' |
| 14380 | */ |
| 14381 | L4_MABX_B.Switch1 = L4_MABX_P.MN_Value; |
| 14382 | } else { |
| 14383 | /* Switch: '<S1010>/Switch1' */ |
| 14384 | L4_MABX_B.Switch1 = L4_MABX_B.Switch_i; |
| 14385 | } |
| 14386 | |
| 14387 | L4_MABX_B.Switch2 = L4_MABX_B.Switch1; |
| 14388 | } |
| 14389 | |
| 14390 | /* End of Switch: '<S1010>/Switch2' */ |
| 14391 | |
| 14392 | /* DataTypeConversion: '<S1010>/DataType' */ |
| 14393 | L4_MABX_B.DataType_gt = L4_MABX_B.Switch2; |
| 14394 | |
| 14395 | /* RelationalOperator: '<S1002>/Operator' incorporates: |
| 14396 | * Constant: '<S983>/Constant1' |
| 14397 | * Constant: '<S983>/Constant6' |
| 14398 | */ |
| 14399 | L4_MABX_B.Operator_ag = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV == |
| 14400 | L4_MABX_P.Constant1_Value_f3); |
| 14401 | |
| 14402 | /* Outputs for Enabled SubSystem: '<S983>/POSITION_CONTROL_MODE' incorporates: |
| 14403 | * EnablePort: '<S1011>/Enable' |
| 14404 | */ |
| 14405 | if (L4_MABX_B.Operator_ag) { |
| 14406 | /* Product: '<S1011>/Product' incorporates: |
| 14407 | * Constant: '<S1011>/Constant' |
| 14408 | */ |
| 14409 | L4_MABX_B.Product = L4_MABX_B.DataType_gt * L4_MABX_P.Constant_Value_g2; |
| 14410 | |
| 14411 | /* DataTypeConversion: '<S1011>/Data Type Conversion' */ |
| 14412 | PositionFinalLimited = floor(L4_MABX_B.Product); |
| 14413 | if (PositionFinalLimited < 2.147483648E+9) { |
| 14414 | if (PositionFinalLimited >= -2.147483648E+9) { |
| 14415 | i = (int32_T)PositionFinalLimited; |
| 14416 | } else { |
| 14417 | i = MIN_int32_T; |
| 14418 | } |
| 14419 | } else { |
| 14420 | i = MAX_int32_T; |
| 14421 | } |
| 14422 | |
| 14423 | L4_MABX_B.Merge = i; |
| 14424 | |
| 14425 | /* End of DataTypeConversion: '<S1011>/Data Type Conversion' */ |
| 14426 | } |
| 14427 | |
| 14428 | /* End of Outputs for SubSystem: '<S983>/POSITION_CONTROL_MODE' */ |
| 14429 | |
| 14430 | /* RelationalOperator: '<S1003>/Operator' incorporates: |
| 14431 | * Constant: '<S983>/Constant2' |
| 14432 | * Constant: '<S983>/Constant6' |
| 14433 | */ |
| 14434 | L4_MABX_B.Operator_mlc = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV == |
| 14435 | L4_MABX_P.Constant2_Value_ky); |
| 14436 | |
| 14437 | /* Outputs for Enabled SubSystem: '<S983>/EXT_TRQ_CTRL_MODE_A' */ |
| 14438 | L4_MABX_ALL_CTRL_DISABLED(L4_MABX_B.Operator_mlc, &L4_MABX_B.Merge, |
| 14439 | &L4_MABX_P.EXT_TRQ_CTRL_MODE_A); |
| 14440 | |
| 14441 | /* End of Outputs for SubSystem: '<S983>/EXT_TRQ_CTRL_MODE_A' */ |
| 14442 | |
| 14443 | /* RelationalOperator: '<S1004>/Operator' incorporates: |
| 14444 | * Constant: '<S983>/Constant3' |
| 14445 | * Constant: '<S983>/Constant6' |
| 14446 | */ |
| 14447 | L4_MABX_B.Operator_og = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV == |
| 14448 | L4_MABX_P.Constant3_Value_gn); |
| 14449 | |
| 14450 | /* Outputs for Enabled SubSystem: '<S983>/ALL_CTRL_DISABLED' */ |
| 14451 | L4_MABX_ALL_CTRL_DISABLED(L4_MABX_B.Operator_og, &L4_MABX_B.Merge, |
| 14452 | &L4_MABX_P.ALL_CTRL_DISABLED); |
| 14453 | |
| 14454 | /* End of Outputs for SubSystem: '<S983>/ALL_CTRL_DISABLED' */ |
| 14455 | |
| 14456 | /* RelationalOperator: '<S1005>/Operator' incorporates: |
| 14457 | * Constant: '<S983>/Constant4' |
| 14458 | * Constant: '<S983>/Constant6' |
| 14459 | */ |
| 14460 | L4_MABX_B.Operator_hj = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV == |
| 14461 | L4_MABX_P.Constant4_Value_b5); |
| 14462 | |
| 14463 | /* Outputs for Enabled SubSystem: '<S983>/EXT_TRQ_CTRL_MODE_B' */ |
| 14464 | L4_MABX_ALL_CTRL_DISABLED(L4_MABX_B.Operator_hj, &L4_MABX_B.Merge, |
| 14465 | &L4_MABX_P.EXT_TRQ_CTRL_MODE_B); |
| 14466 | |
| 14467 | /* End of Outputs for SubSystem: '<S983>/EXT_TRQ_CTRL_MODE_B' */ |
| 14468 | |
| 14469 | /* RelationalOperator: '<S1006>/Operator' incorporates: |
| 14470 | * Constant: '<S983>/Constant5' |
| 14471 | * Constant: '<S983>/Constant6' |
| 14472 | */ |
| 14473 | L4_MABX_B.Operator_pg = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV == |
| 14474 | L4_MABX_P.Constant5_Value_k); |
| 14475 | |
| 14476 | /* Outputs for Enabled SubSystem: '<S983>/EXT_TRQ_CTRL_MODE_C' */ |
| 14477 | L4_MABX_ALL_CTRL_DISABLED(L4_MABX_B.Operator_pg, &L4_MABX_B.Merge, |
| 14478 | &L4_MABX_P.EXT_TRQ_CTRL_MODE_C); |
| 14479 | |
| 14480 | /* End of Outputs for SubSystem: '<S983>/EXT_TRQ_CTRL_MODE_C' */ |
| 14481 | |
| 14482 | /* DataTypeConversion: '<S982>/Data Type Conversion2' */ |
| 14483 | L4_MABX_B.DataTypeConversion2_a5 = (uint32_T)L4_MABX_B.Merge; |
| 14484 | |
| 14485 | /* S-Function (sfix_bitop): '<S987>/Operator' */ |
| 14486 | L4_MABX_B.Operator_i = L4_MABX_B.DataTypeConversion2_a5 & |
| 14487 | L4_MABX_P.Operator_BitMask_if; |
| 14488 | |
| 14489 | /* DataTypeConversion: '<S987>/DataType' */ |
| 14490 | tmp = L4_MABX_B.Operator_i; |
| 14491 | if (tmp > 255U) { |
| 14492 | tmp = 255U; |
| 14493 | } |
| 14494 | |
| 14495 | L4_MABX_B.DataType_km = (uint8_T)tmp; |
| 14496 | |
| 14497 | /* End of DataTypeConversion: '<S987>/DataType' */ |
| 14498 | |
| 14499 | /* S-Function (sfix_bitop): '<S988>/Operator' */ |
| 14500 | L4_MABX_B.Operator_f = L4_MABX_B.DataTypeConversion2_a5 & |
| 14501 | L4_MABX_P.Operator_BitMask_kh; |
| 14502 | |
| 14503 | /* DataTypeConversion: '<S988>/DataType' */ |
| 14504 | tmp = L4_MABX_B.Operator_f; |
| 14505 | if (tmp > 65535U) { |
| 14506 | tmp = 65535U; |
| 14507 | } |
| 14508 | |
| 14509 | L4_MABX_B.DataType_ac = (uint16_T)tmp; |
| 14510 | |
| 14511 | /* End of DataTypeConversion: '<S988>/DataType' */ |
| 14512 | |
| 14513 | /* ArithShift: '<S982>/Shift_Arithmetic ' */ |
| 14514 | L4_MABX_B.Shift_Arithmetic_fy = (uint16_T)((uint32_T)L4_MABX_B.DataType_ac >> |
| 14515 | 8); |
| 14516 | |
| 14517 | /* DataTypeConversion: '<S982>/Data Type Conversion4' */ |
| 14518 | tmp_0 = L4_MABX_B.Shift_Arithmetic_fy; |
| 14519 | if (tmp_0 > 255) { |
| 14520 | tmp_0 = 255U; |
| 14521 | } |
| 14522 | |
| 14523 | L4_MABX_B.DataTypeConversion4_o = (uint8_T)tmp_0; |
| 14524 | |
| 14525 | /* End of DataTypeConversion: '<S982>/Data Type Conversion4' */ |
| 14526 | |
| 14527 | /* S-Function (sfix_bitop): '<S989>/Operator' */ |
| 14528 | L4_MABX_B.Operator_a = L4_MABX_B.DataTypeConversion2_a5 & |
| 14529 | L4_MABX_P.Operator_BitMask_be; |
| 14530 | |
| 14531 | /* DataTypeConversion: '<S989>/DataType' */ |
| 14532 | L4_MABX_B.DataType_am = L4_MABX_B.Operator_a; |
| 14533 | |
| 14534 | /* ArithShift: '<S982>/Shift_Arithmetic 1' */ |
| 14535 | L4_MABX_B.Shift_Arithmetic1_n = L4_MABX_B.DataType_am >> 16; |
| 14536 | |
| 14537 | /* DataTypeConversion: '<S982>/Data Type Conversion5' */ |
| 14538 | tmp = L4_MABX_B.Shift_Arithmetic1_n; |
| 14539 | if (tmp > 255U) { |
| 14540 | tmp = 255U; |
| 14541 | } |
| 14542 | |
| 14543 | L4_MABX_B.DataTypeConversion5_k = (uint8_T)tmp; |
| 14544 | |
| 14545 | /* End of DataTypeConversion: '<S982>/Data Type Conversion5' */ |
| 14546 | |
| 14547 | /* S-Function (sfix_bitop): '<S990>/Operator' */ |
| 14548 | L4_MABX_B.Operator_e = L4_MABX_B.DataTypeConversion2_a5 & |
| 14549 | L4_MABX_P.Operator_BitMask_ai; |
| 14550 | |
| 14551 | /* DataTypeConversion: '<S990>/DataType' */ |
| 14552 | L4_MABX_B.DataType_h = L4_MABX_B.Operator_e; |
| 14553 | |
| 14554 | /* ArithShift: '<S982>/Shift_Arithmetic 2' */ |
| 14555 | L4_MABX_B.Shift_Arithmetic2_ar = L4_MABX_B.DataType_h >> 24; |
| 14556 | |
| 14557 | /* DataTypeConversion: '<S982>/Data Type Conversion6' */ |
| 14558 | tmp = L4_MABX_B.Shift_Arithmetic2_ar; |
| 14559 | if (tmp > 255U) { |
| 14560 | tmp = 255U; |
| 14561 | } |
| 14562 | |
| 14563 | L4_MABX_B.DataTypeConversion6_i = (uint8_T)tmp; |
| 14564 | |
| 14565 | /* End of DataTypeConversion: '<S982>/Data Type Conversion6' */ |
| 14566 | |
| 14567 | /* Reshape: '<S1012>/Reshape' incorporates: |
| 14568 | * Constant: '<S1012>/Constant' |
| 14569 | */ |
| 14570 | for (i = 0; i < 16; i++) { |
| 14571 | L4_MABX_B.Reshape_ik[i] = L4_MABX_P.Repeating_Sequence_Stair_OutV_g[i]; |
| 14572 | } |
| 14573 | |
| 14574 | /* End of Reshape: '<S1012>/Reshape' */ |
| 14575 | |
| 14576 | /* UnitDelay: '<S1012>/Unit_Delay' */ |
| 14577 | L4_MABX_B.Unit_Delay_n1 = L4_MABX_DW.Unit_Delay_DSTATE_mr; |
| 14578 | |
| 14579 | /* UnitDelay: '<S1013>/Unit Delay' */ |
| 14580 | L4_MABX_B.UnitDelay_a = L4_MABX_DW.UnitDelay_DSTATE_c; |
| 14581 | |
| 14582 | /* Switch: '<S1016>/Switch1' incorporates: |
| 14583 | * Constant: '<S1013>/E' |
| 14584 | * Constant: '<S1013>/IV' |
| 14585 | * Switch: '<S1015>/Switch1' |
| 14586 | */ |
| 14587 | if (L4_MABX_B.Unit_Delay_n1) { |
| 14588 | L4_MABX_B.Switch1_a = L4_MABX_P.IV_Value_ms; |
| 14589 | } else { |
| 14590 | if (L4_MABX_P.E_Value_a) { |
| 14591 | /* Sum: '<S1013>/Subtract' incorporates: |
| 14592 | * Constant: '<S1013>/Constant' |
| 14593 | * Switch: '<S1015>/Switch1' |
| 14594 | */ |
| 14595 | q0 = L4_MABX_P.Constant_Value_oi; |
| 14596 | tmp = q0 + L4_MABX_B.UnitDelay_a; |
| 14597 | if (tmp < q0) { |
| 14598 | tmp = MAX_uint32_T; |
| 14599 | } |
| 14600 | |
| 14601 | L4_MABX_B.Subtract_ou = tmp; |
| 14602 | |
| 14603 | /* End of Sum: '<S1013>/Subtract' */ |
| 14604 | |
| 14605 | /* Switch: '<S1015>/Switch1' */ |
| 14606 | L4_MABX_B.Switch1_b = L4_MABX_B.Subtract_ou; |
| 14607 | } else { |
| 14608 | /* Switch: '<S1015>/Switch1' */ |
| 14609 | L4_MABX_B.Switch1_b = L4_MABX_B.UnitDelay_a; |
| 14610 | } |
| 14611 | |
| 14612 | L4_MABX_B.Switch1_a = L4_MABX_B.Switch1_b; |
| 14613 | } |
| 14614 | |
| 14615 | /* End of Switch: '<S1016>/Switch1' */ |
| 14616 | |
| 14617 | /* Selector: '<S1012>/Selector' */ |
| 14618 | L4_MABX_B.Selector_o = L4_MABX_B.Reshape_ik[(int32_T)L4_MABX_B.Switch1_a - 1]; |
| 14619 | |
| 14620 | /* DataTypeConversion: '<S982>/Data Type Conversion1' */ |
| 14621 | L4_MABX_B.DataTypeConversion1_gn = L4_MABX_B.Selector_o; |
| 14622 | |
| 14623 | /* S-Function (sfix_bitop): '<S995>/Operator' */ |
| 14624 | L4_MABX_B.Operator_k4 = (uint8_T)(L4_MABX_B.DataTypeConversion1_gn & |
| 14625 | L4_MABX_P.Operator_BitMask_de); |
| 14626 | |
| 14627 | /* DataTypeConversion: '<S995>/DataType' */ |
| 14628 | L4_MABX_B.DataType_g4 = L4_MABX_B.Operator_k4; |
| 14629 | |
| 14630 | /* DataTypeConversion: '<S981>/Data Type Conversion' incorporates: |
| 14631 | * Constant: '<S981>/Priority' |
| 14632 | */ |
| 14633 | L4_MABX_B.DataTypeConversion_h = L4_MABX_P.Priority_Value_l; |
| 14634 | |
| 14635 | /* ArithShift: '<S981>/Shift_Arithmetic ' */ |
| 14636 | L4_MABX_B.Shift_Arithmetic_a = L4_MABX_B.DataTypeConversion_h << 26; |
| 14637 | |
| 14638 | /* DataTypeConversion: '<S981>/Data Type Conversion1' incorporates: |
| 14639 | * Constant: '<S981>/ExtendedDataPage' |
| 14640 | */ |
| 14641 | L4_MABX_B.DataTypeConversion1_ha = L4_MABX_P.ExtendedDataPage_Value_n; |
| 14642 | |
| 14643 | /* ArithShift: '<S981>/Shift_Arithmetic 1' */ |
| 14644 | L4_MABX_B.Shift_Arithmetic1_e = L4_MABX_B.DataTypeConversion1_ha << 25; |
| 14645 | |
| 14646 | /* DataTypeConversion: '<S981>/Data Type Conversion2' incorporates: |
| 14647 | * Constant: '<S981>/DataPage' |
| 14648 | */ |
| 14649 | L4_MABX_B.DataTypeConversion2_om = L4_MABX_P.DataPage_Value_p; |
| 14650 | |
| 14651 | /* ArithShift: '<S981>/Shift_Arithmetic 2' */ |
| 14652 | L4_MABX_B.Shift_Arithmetic2_d = L4_MABX_B.DataTypeConversion2_om << 24; |
| 14653 | |
| 14654 | /* DataTypeConversion: '<S981>/Data Type Conversion3' incorporates: |
| 14655 | * Constant: '<S981>/PDUFormat' |
| 14656 | */ |
| 14657 | L4_MABX_B.DataTypeConversion3_i = L4_MABX_P.PDUFormat_Value_b; |
| 14658 | |
| 14659 | /* ArithShift: '<S981>/Shift_Arithmetic 3' */ |
| 14660 | L4_MABX_B.Shift_Arithmetic3_h = L4_MABX_B.DataTypeConversion3_i << 16; |
| 14661 | |
| 14662 | /* DataTypeConversion: '<S981>/Data Type Conversion4' incorporates: |
| 14663 | * Constant: '<S981>/PDUSpecific' |
| 14664 | */ |
| 14665 | L4_MABX_B.DataTypeConversion4_b5 = L4_MABX_P.PDUSpecific_Value_j; |
| 14666 | |
| 14667 | /* ArithShift: '<S981>/Shift_Arithmetic 4' */ |
| 14668 | L4_MABX_B.Shift_Arithmetic4_nx = L4_MABX_B.DataTypeConversion4_b5 << 8; |
| 14669 | |
| 14670 | /* DataTypeConversion: '<S981>/Data Type Conversion5' incorporates: |
| 14671 | * Constant: '<S981>/SourceAddress' |
| 14672 | */ |
| 14673 | L4_MABX_B.DataTypeConversion5_c = L4_MABX_P.SourceAddress_Value_p; |
| 14674 | |
| 14675 | /* S-Function (sfix_bitop): '<S986>/Operator' */ |
| 14676 | L4_MABX_B.Operator_l = L4_MABX_B.Shift_Arithmetic_a | |
| 14677 | L4_MABX_B.Shift_Arithmetic1_e | L4_MABX_B.Shift_Arithmetic2_d | |
| 14678 | L4_MABX_B.Shift_Arithmetic3_h | L4_MABX_B.Shift_Arithmetic4_nx | |
| 14679 | L4_MABX_B.DataTypeConversion5_c; |
| 14680 | |
| 14681 | /* DataTypeConversion: '<S986>/DataType' */ |
| 14682 | L4_MABX_B.DataType_jf = L4_MABX_B.Operator_l; |
| 14683 | |
| 14684 | /* DataTypeConversion: '<S982>/Data Type Conversion3' */ |
| 14685 | L4_MABX_B.DataTypeConversion3_mr = L4_MABX_B.DataType_jf; |
| 14686 | |
| 14687 | /* S-Function (sfix_bitop): '<S991>/Operator' */ |
| 14688 | L4_MABX_B.Operator_n = L4_MABX_B.DataTypeConversion3_mr & |
| 14689 | L4_MABX_P.Operator_BitMask_kt; |
| 14690 | |
| 14691 | /* DataTypeConversion: '<S991>/DataType' */ |
| 14692 | tmp = L4_MABX_B.Operator_n; |
| 14693 | if (tmp > 255U) { |
| 14694 | tmp = 255U; |
| 14695 | } |
| 14696 | |
| 14697 | L4_MABX_B.DataType_ea = (uint8_T)tmp; |
| 14698 | |
| 14699 | /* End of DataTypeConversion: '<S991>/DataType' */ |
| 14700 | |
| 14701 | /* S-Function (sfix_bitop): '<S992>/Operator' */ |
| 14702 | L4_MABX_B.Operator_ar = L4_MABX_B.DataTypeConversion3_mr & |
| 14703 | L4_MABX_P.Operator_BitMask_en; |
| 14704 | |
| 14705 | /* DataTypeConversion: '<S992>/DataType' */ |
| 14706 | tmp = L4_MABX_B.Operator_ar; |
| 14707 | if (tmp > 65535U) { |
| 14708 | tmp = 65535U; |
| 14709 | } |
| 14710 | |
| 14711 | L4_MABX_B.DataType_ew = (uint16_T)tmp; |
| 14712 | |
| 14713 | /* End of DataTypeConversion: '<S992>/DataType' */ |
| 14714 | |
| 14715 | /* ArithShift: '<S982>/Shift_Arithmetic 3' */ |
| 14716 | L4_MABX_B.Shift_Arithmetic3_eh = (uint16_T)((uint32_T)L4_MABX_B.DataType_ew >> |
| 14717 | 8); |
| 14718 | |
| 14719 | /* DataTypeConversion: '<S982>/Data Type Conversion8' */ |
| 14720 | tmp_0 = L4_MABX_B.Shift_Arithmetic3_eh; |
| 14721 | if (tmp_0 > 255) { |
| 14722 | tmp_0 = 255U; |
| 14723 | } |
| 14724 | |
| 14725 | L4_MABX_B.DataTypeConversion8_g = (uint8_T)tmp_0; |
| 14726 | |
| 14727 | /* End of DataTypeConversion: '<S982>/Data Type Conversion8' */ |
| 14728 | |
| 14729 | /* S-Function (sfix_bitop): '<S993>/Operator' */ |
| 14730 | L4_MABX_B.Operator_db = L4_MABX_B.DataTypeConversion3_mr & |
| 14731 | L4_MABX_P.Operator_BitMask_et; |
| 14732 | |
| 14733 | /* DataTypeConversion: '<S993>/DataType' */ |
| 14734 | L4_MABX_B.DataType_hs = L4_MABX_B.Operator_db; |
| 14735 | |
| 14736 | /* ArithShift: '<S982>/Shift_Arithmetic 4' */ |
| 14737 | L4_MABX_B.Shift_Arithmetic4_nb = L4_MABX_B.DataType_hs >> 16; |
| 14738 | |
| 14739 | /* DataTypeConversion: '<S982>/Data Type Conversion9' */ |
| 14740 | tmp = L4_MABX_B.Shift_Arithmetic4_nb; |
| 14741 | if (tmp > 255U) { |
| 14742 | tmp = 255U; |
| 14743 | } |
| 14744 | |
| 14745 | L4_MABX_B.DataTypeConversion9_d = (uint8_T)tmp; |
| 14746 | |
| 14747 | /* End of DataTypeConversion: '<S982>/Data Type Conversion9' */ |
| 14748 | |
| 14749 | /* S-Function (sfix_bitop): '<S994>/Operator' */ |
| 14750 | L4_MABX_B.Operator_h = L4_MABX_B.DataTypeConversion3_mr & |
| 14751 | L4_MABX_P.Operator_BitMask_it; |
| 14752 | |
| 14753 | /* DataTypeConversion: '<S994>/DataType' */ |
| 14754 | L4_MABX_B.DataType_kr = L4_MABX_B.Operator_h; |
| 14755 | |
| 14756 | /* ArithShift: '<S982>/Shift_Arithmetic 5' */ |
| 14757 | L4_MABX_B.Shift_Arithmetic5_i = L4_MABX_B.DataType_kr >> 24; |
| 14758 | |
| 14759 | /* DataTypeConversion: '<S982>/Data Type Conversion10' */ |
| 14760 | tmp = L4_MABX_B.Shift_Arithmetic5_i; |
| 14761 | if (tmp > 255U) { |
| 14762 | tmp = 255U; |
| 14763 | } |
| 14764 | |
| 14765 | L4_MABX_B.DataTypeConversion10_n = (uint8_T)tmp; |
| 14766 | |
| 14767 | /* End of DataTypeConversion: '<S982>/Data Type Conversion10' */ |
| 14768 | |
| 14769 | /* Sum: '<S982>/Add' incorporates: |
| 14770 | * Constant: '<S982>/Constant' |
| 14771 | * Constant: '<S982>/Constant1' |
| 14772 | */ |
| 14773 | L4_MABX_B.Add_aut = (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T) |
| 14774 | ((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T) |
| 14775 | (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T) |
| 14776 | ((uint32_T)(uint8_T)((uint32_T)L4_MABX_B.DataTypeConversion_e3 + |
| 14777 | L4_MABX_B.DataType_km) + L4_MABX_B.DataTypeConversion4_o) + |
| 14778 | L4_MABX_B.DataTypeConversion5_k) + L4_MABX_B.DataTypeConversion6_i) + |
| 14779 | L4_MABX_P.Constant_Value_dx) + L4_MABX_P.Constant1_Value_ef) + |
| 14780 | L4_MABX_B.DataType_ea) + L4_MABX_B.DataTypeConversion8_g) + |
| 14781 | L4_MABX_B.DataTypeConversion9_d) + L4_MABX_B.DataTypeConversion10_n) + |
| 14782 | L4_MABX_B.DataType_g4); |
| 14783 | |
| 14784 | /* ArithShift: '<S982>/Shift_Arithmetic 6' */ |
| 14785 | L4_MABX_B.Shift_Arithmetic6_j = (uint8_T)((uint32_T)L4_MABX_B.Add_aut >> 4); |
| 14786 | |
| 14787 | /* Sum: '<S982>/Add1' */ |
| 14788 | L4_MABX_B.Add1_j = (uint8_T)((uint32_T)L4_MABX_B.Shift_Arithmetic6_j + |
| 14789 | L4_MABX_B.Add_aut); |
| 14790 | |
| 14791 | /* S-Function (sfix_bitop): '<S996>/Operator' */ |
| 14792 | L4_MABX_B.Operator_jn = (uint8_T)(L4_MABX_B.Add1_j & |
| 14793 | L4_MABX_P.Operator_BitMask_po); |
| 14794 | |
| 14795 | /* DataTypeConversion: '<S996>/DataType' */ |
| 14796 | L4_MABX_B.DataType_e5 = L4_MABX_B.Operator_jn; |
| 14797 | |
| 14798 | /* ArithShift: '<S982>/Shift_Arithmetic 7' */ |
| 14799 | L4_MABX_B.Shift_Arithmetic7_e = (uint8_T)(L4_MABX_B.DataType_e5 << 4); |
| 14800 | |
| 14801 | /* S-Function (sfix_bitop): '<S997>/Operator' */ |
| 14802 | L4_MABX_B.Operator_f2 = (uint8_T)(L4_MABX_B.DataType_g4 | |
| 14803 | L4_MABX_B.Shift_Arithmetic7_e); |
| 14804 | |
| 14805 | /* DataTypeConversion: '<S997>/DataType' */ |
| 14806 | L4_MABX_B.DataType_ci = L4_MABX_B.Operator_f2; |
| 14807 | |
| 14808 | /* DataTypeConversion: '<S948>/Data Type Conversion1' incorporates: |
| 14809 | * Constant: '<S982>/Constant' |
| 14810 | * Constant: '<S982>/Constant1' |
| 14811 | */ |
| 14812 | L4_MABX_B.DataTypeConversion1_j[0] = L4_MABX_B.DataTypeConversion_e3; |
| 14813 | L4_MABX_B.DataTypeConversion1_j[1] = L4_MABX_B.DataType_km; |
| 14814 | L4_MABX_B.DataTypeConversion1_j[2] = L4_MABX_B.DataTypeConversion4_o; |
| 14815 | L4_MABX_B.DataTypeConversion1_j[3] = L4_MABX_B.DataTypeConversion5_k; |
| 14816 | L4_MABX_B.DataTypeConversion1_j[4] = L4_MABX_B.DataTypeConversion6_i; |
| 14817 | L4_MABX_B.DataTypeConversion1_j[5] = L4_MABX_P.Constant_Value_dx; |
| 14818 | L4_MABX_B.DataTypeConversion1_j[6] = L4_MABX_P.Constant1_Value_ef; |
| 14819 | L4_MABX_B.DataTypeConversion1_j[7] = L4_MABX_B.DataType_ci; |
| 14820 | |
| 14821 | /* Outputs for Enabled SubSystem: '<S969>/PropB_REAX_1_E4' incorporates: |
| 14822 | * EnablePort: '<S971>/Enable' |
| 14823 | */ |
| 14824 | if (L4_MABX_B.Operator_nc) { |
| 14825 | /* S-Function (rti_commonblock): '<S971>/S-Function1' incorporates: |
| 14826 | * Constant: '<S969>/Constant' |
| 14827 | * Constant: '<S969>/Constant1' |
| 14828 | */ |
| 14829 | /* This comment workarounds a code generation problem */ |
| 14830 | |
| 14831 | /* dSPACE RTICAN TX Message Block: "PropB_REAX_1_E4" Id:419426276 */ |
| 14832 | { |
| 14833 | static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 14834 | 0x00 }; |
| 14835 | |
| 14836 | Float32 delayTime = 0.0; |
| 14837 | |
| 14838 | /* link this pointer to CAN_Msg for use in initialize_io_units() */ |
| 14839 | CANTP1_PTR_M1_C2_XTD_0x18FFEFE4 = &(CAN_Msg[0]); |
| 14840 | |
| 14841 | /* ... perform loop-back if required */ |
| 14842 | if (L4_MABX_P.Constant1_Value_lp > 0.5) { |
| 14843 | /* ... updating the used tx-clientbuffer */ |
| 14844 | can_tp1_msg_update_all( CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->module, |
| 14845 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->queue ); |
| 14846 | |
| 14847 | /* ... Read status and timestamp info perform loop-back (previous message) */ |
| 14848 | can_tp1_tx_msg_read_loopback(CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4, |
| 14849 | 8, // datalen |
| 14850 | &(CAN_Msg[0]), |
| 14851 | CANTP1_RX_SPMSG_M1_C2_XTD); |
| 14852 | |
| 14853 | /* Convert timestamp */ |
| 14854 | if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->processed) { |
| 14855 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp = |
| 14856 | rtk_dsts_time_to_simtime_convert |
| 14857 | (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp); |
| 14858 | } |
| 14859 | } else { |
| 14860 | /* ... Read status and timestamp info (previous message) */ |
| 14861 | can_tp1_msg_read_from_dsmcr(CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4); |
| 14862 | |
| 14863 | /* Convert timestamp */ |
| 14864 | if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->processed) { |
| 14865 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp = |
| 14866 | rtk_dsts_time_to_simtime_convert |
| 14867 | (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp); |
| 14868 | } |
| 14869 | } |
| 14870 | |
| 14871 | /* Messages with timestamp zero have been received in pause/stop state |
| 14872 | and must not be handled. |
| 14873 | */ |
| 14874 | if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp > 0.0) { |
| 14875 | L4_MABX_B.SFunction1_o1_oc = (real_T) |
| 14876 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->processed; |
| 14877 | L4_MABX_B.SFunction1_o2_c = (real_T) |
| 14878 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp; |
| 14879 | L4_MABX_B.SFunction1_o3_f = (real_T) |
| 14880 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->deltatime; |
| 14881 | L4_MABX_B.SFunction1_o4_n = (real_T) |
| 14882 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->delaytime; |
| 14883 | } |
| 14884 | |
| 14885 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 14886 | { |
| 14887 | rtican_Signal_t CAN_Sgn; |
| 14888 | UInt32 i; |
| 14889 | |
| 14890 | /* Initialize the static message data to zero */ |
| 14891 | for (i=0; i<8; i++ ) |
| 14892 | CAN_Msg[i] = 0; |
| 14893 | |
| 14894 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 14895 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14896 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_j[0] ) + |
| 14897 | 0.5); |
| 14898 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14899 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 14900 | |
| 14901 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 14902 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14903 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_j[1] ) + |
| 14904 | 0.5); |
| 14905 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14906 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 14907 | |
| 14908 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 14909 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14910 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_j[2] ) + |
| 14911 | 0.5); |
| 14912 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14913 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 14914 | |
| 14915 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 14916 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14917 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_j[3] ) + |
| 14918 | 0.5); |
| 14919 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14920 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 14921 | |
| 14922 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 14923 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14924 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_j[4] ) + |
| 14925 | 0.5); |
| 14926 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14927 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 14928 | |
| 14929 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 14930 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14931 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_j[5] ) + |
| 14932 | 0.5); |
| 14933 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14934 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 14935 | |
| 14936 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 14937 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14938 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_j[6] ) + |
| 14939 | 0.5); |
| 14940 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14941 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 14942 | |
| 14943 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 14944 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14945 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_j[7] ) + |
| 14946 | 0.5); |
| 14947 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14948 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 14949 | } |
| 14950 | |
| 14951 | delayTime = (Float32) L4_MABX_P.Constant_Value_f4 / (1700); |
| 14952 | |
| 14953 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 14954 | can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FFEFE4], 8, |
| 14955 | &(CAN_Msg[0]), delayTime); |
| 14956 | } |
| 14957 | } |
| 14958 | |
| 14959 | /* End of Outputs for SubSystem: '<S969>/PropB_REAX_1_E4' */ |
| 14960 | |
| 14961 | /* Outputs for Enabled SubSystem: '<S970>/PropB_REAX_1_E4' incorporates: |
| 14962 | * EnablePort: '<S972>/Enable' |
| 14963 | */ |
| 14964 | if (L4_MABX_B.EnablePropB_ReAX_CAN6) { |
| 14965 | /* S-Function (rti_commonblock): '<S972>/S-Function1' incorporates: |
| 14966 | * Constant: '<S970>/Constant' |
| 14967 | * Constant: '<S970>/Constant1' |
| 14968 | */ |
| 14969 | /* This comment workarounds a code generation problem */ |
| 14970 | |
| 14971 | /* dSPACE RTICAN TX Message Block: "PropB_REAX_1_E4" Id:419426276 */ |
| 14972 | { |
| 14973 | static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 14974 | 0x00 }; |
| 14975 | |
| 14976 | Float32 delayTime = 0.0; |
| 14977 | |
| 14978 | /* link this pointer to CAN_Msg for use in initialize_io_units() */ |
| 14979 | CANTP1_PTR_M3_C2_XTD_0x18FFEFE4 = &(CAN_Msg[0]); |
| 14980 | |
| 14981 | /* ... perform loop-back if required */ |
| 14982 | if (L4_MABX_P.Constant1_Value_ad > 0.5) { |
| 14983 | /* ... updating the used tx-clientbuffer */ |
| 14984 | can_tp1_msg_update_all( CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->module, |
| 14985 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->queue ); |
| 14986 | |
| 14987 | /* ... Read status and timestamp info perform loop-back (previous message) */ |
| 14988 | can_tp1_tx_msg_read_loopback(CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4, |
| 14989 | 8, // datalen |
| 14990 | &(CAN_Msg[0]), |
| 14991 | CANTP1_RX_SPMSG_M3_C2_XTD); |
| 14992 | |
| 14993 | /* Convert timestamp */ |
| 14994 | if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->processed) { |
| 14995 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp = |
| 14996 | rtk_dsts_time_to_simtime_convert |
| 14997 | (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp); |
| 14998 | } |
| 14999 | } else { |
| 15000 | /* ... Read status and timestamp info (previous message) */ |
| 15001 | can_tp1_msg_read_from_dsmcr(CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4); |
| 15002 | |
| 15003 | /* Convert timestamp */ |
| 15004 | if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->processed) { |
| 15005 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp = |
| 15006 | rtk_dsts_time_to_simtime_convert |
| 15007 | (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp); |
| 15008 | } |
| 15009 | } |
| 15010 | |
| 15011 | /* Messages with timestamp zero have been received in pause/stop state |
| 15012 | and must not be handled. |
| 15013 | */ |
| 15014 | if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp > 0.0) { |
| 15015 | L4_MABX_B.SFunction1_o1_m = (real_T) |
| 15016 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->processed; |
| 15017 | L4_MABX_B.SFunction1_o2_gj = (real_T) |
| 15018 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp; |
| 15019 | L4_MABX_B.SFunction1_o3_mj = (real_T) |
| 15020 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->deltatime; |
| 15021 | L4_MABX_B.SFunction1_o4_j = (real_T) |
| 15022 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->delaytime; |
| 15023 | } |
| 15024 | |
| 15025 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 15026 | { |
| 15027 | rtican_Signal_t CAN_Sgn; |
| 15028 | UInt32 i; |
| 15029 | |
| 15030 | /* Initialize the static message data to zero */ |
| 15031 | for (i=0; i<8; i++ ) |
| 15032 | CAN_Msg[i] = 0; |
| 15033 | |
| 15034 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 15035 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15036 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_j[0] ) + |
| 15037 | 0.5); |
| 15038 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15039 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 15040 | |
| 15041 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 15042 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15043 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_j[1] ) + |
| 15044 | 0.5); |
| 15045 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15046 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 15047 | |
| 15048 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 15049 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15050 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_j[2] ) + |
| 15051 | 0.5); |
| 15052 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15053 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 15054 | |
| 15055 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 15056 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15057 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_j[3] ) + |
| 15058 | 0.5); |
| 15059 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15060 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 15061 | |
| 15062 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 15063 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15064 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_j[4] ) + |
| 15065 | 0.5); |
| 15066 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15067 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 15068 | |
| 15069 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 15070 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15071 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_j[5] ) + |
| 15072 | 0.5); |
| 15073 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15074 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 15075 | |
| 15076 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 15077 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15078 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_j[6] ) + |
| 15079 | 0.5); |
| 15080 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15081 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 15082 | |
| 15083 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 15084 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15085 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_j[7] ) + |
| 15086 | 0.5); |
| 15087 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15088 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 15089 | } |
| 15090 | |
| 15091 | delayTime = (Float32) L4_MABX_P.Constant_Value_em / (1700); |
| 15092 | |
| 15093 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 15094 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0X18FFEFE4], 8, |
| 15095 | &(CAN_Msg[0]), delayTime); |
| 15096 | } |
| 15097 | } |
| 15098 | |
| 15099 | /* End of Outputs for SubSystem: '<S970>/PropB_REAX_1_E4' */ |
| 15100 | |
| 15101 | /* DataTypeConversion: '<S949>/Data Type Conversion' incorporates: |
| 15102 | * Constant: '<S860>/CANT_VDC2_0B_CHANNEL_APV' |
| 15103 | */ |
| 15104 | L4_MABX_B.DataTypeConversion_ng = (uint8_T) |
| 15105 | L4_MABX_P.CANT_VDC2_0B_CHANNEL_APV_Value; |
| 15106 | |
| 15107 | /* S-Function (sfix_bitop): '<S977>/Operator' */ |
| 15108 | L4_MABX_B.Operator_iq = (uint8_T)(L4_MABX_B.DataTypeConversion_ng & |
| 15109 | L4_MABX_P.Operator_BitMask_hp); |
| 15110 | |
| 15111 | /* DataTypeConversion: '<S977>/DataType' */ |
| 15112 | L4_MABX_B.DataType_l0 = L4_MABX_B.Operator_iq; |
| 15113 | |
| 15114 | /* ArithShift: '<S949>/Shift_Arithmetic 3' */ |
| 15115 | L4_MABX_B.Shift_Arithmetic3_f = ldexp(L4_MABX_B.DataType_l0, (-4)); |
| 15116 | |
| 15117 | /* DataTypeConversion: '<S949>/Data Type Conversion6' */ |
| 15118 | L4_MABX_B.DataTypeConversion6_ki = (L4_MABX_B.Shift_Arithmetic3_f != 0.0); |
| 15119 | |
| 15120 | /* Outputs for Enabled SubSystem: '<S979>/VDC2_0B' incorporates: |
| 15121 | * EnablePort: '<S980>/Enable' |
| 15122 | */ |
| 15123 | if (L4_MABX_B.DataTypeConversion6_ki) { |
| 15124 | /* S-Function (rti_commonblock): '<S980>/S-Function1' */ |
| 15125 | /* This comment workarounds a code generation problem */ |
| 15126 | |
| 15127 | /* dSPACE RTICAN TX Message Block: "VDC2_0B" Id:418384139 */ |
| 15128 | { |
| 15129 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 15130 | |
| 15131 | Float32 delayTime = 0.0; |
| 15132 | |
| 15133 | /* ... Read status and timestamp info (previous message) */ |
| 15134 | can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]); |
| 15135 | |
| 15136 | /* Convert timestamp */ |
| 15137 | if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->processed) { |
| 15138 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->timestamp = |
| 15139 | rtk_dsts_time_to_simtime_convert |
| 15140 | (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->timestamp); |
| 15141 | } |
| 15142 | |
| 15143 | /* Messages with timestamp zero have been received in pause/stop state |
| 15144 | and must not be handled. |
| 15145 | */ |
| 15146 | if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->timestamp > 0.0) { |
| 15147 | L4_MABX_B.SFunction1_o1_l1 = (real_T) |
| 15148 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->processed; |
| 15149 | L4_MABX_B.SFunction1_o2_er = (real_T) |
| 15150 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->timestamp; |
| 15151 | L4_MABX_B.SFunction1_o3_bp = (real_T) |
| 15152 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->deltatime; |
| 15153 | L4_MABX_B.SFunction1_o4_m = (real_T) |
| 15154 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->delaytime; |
| 15155 | } |
| 15156 | |
| 15157 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 15158 | { |
| 15159 | rtican_Signal_t CAN_Sgn; |
| 15160 | |
| 15161 | /* ...... "SteerWheelAngle" (0|16, standard signal, unsigned int, little endian) */ |
| 15162 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15163 | CAN_Sgn.UnsignedSgn = (UInt32) (( SteerWheelAngle - ( -31.374 ) ) / |
| 15164 | 0.0009765625 + 0.5); |
| 15165 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 15166 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 15167 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte1; |
| 15168 | |
| 15169 | /* ...... "SteerWheelTurnCounter" (16|6, standard signal, unsigned int, little endian) */ |
| 15170 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15171 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.SFunction1_o2_gn - ( -32 ) + |
| 15172 | 0.5); |
| 15173 | CAN_Sgn.UnsignedSgn &= 0x0000003F; |
| 15174 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 15175 | |
| 15176 | /* ...... "SteerWheelAngleSensorType" (22|2, standard signal, unsigned int, little endian) */ |
| 15177 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15178 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o3_jk ) + 0.5); |
| 15179 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15180 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 15181 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 15182 | |
| 15183 | /* ...... "YawRate" (24|16, standard signal, unsigned int, little endian) */ |
| 15184 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15185 | CAN_Sgn.UnsignedSgn = (UInt32) (( YawRate - ( -3.92 ) ) / |
| 15186 | 0.0001220703125 + 0.5); |
| 15187 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 15188 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 15189 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte1; |
| 15190 | |
| 15191 | /* ...... "LateralAcceleration" (40|16, standard signal, unsigned int, little endian) */ |
| 15192 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15193 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o5_f - ( -15.687 ) |
| 15194 | ) / 0.00048828125 + 0.5); |
| 15195 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 15196 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 15197 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte1; |
| 15198 | |
| 15199 | /* ...... "LongitudinalAcceleration" (56|8, standard signal, unsigned int, little endian) */ |
| 15200 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15201 | CAN_Sgn.UnsignedSgn = (UInt32) (( SPN1810_LongitudinalAcceleration - |
| 15202 | ( -12.5 ) ) / 0.1 + 0.5); |
| 15203 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15204 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 15205 | } |
| 15206 | |
| 15207 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 15208 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B], 8, |
| 15209 | &(CAN_Msg[0]), delayTime); |
| 15210 | } |
| 15211 | } |
| 15212 | |
| 15213 | /* End of Outputs for SubSystem: '<S979>/VDC2_0B' */ |
| 15214 | |
| 15215 | /* S-Function (sfix_bitop): '<S973>/Operator' */ |
| 15216 | L4_MABX_B.Operator_ev = (uint8_T)(L4_MABX_B.DataTypeConversion_ng & |
| 15217 | L4_MABX_P.Operator_BitMask_cl); |
| 15218 | |
| 15219 | /* DataTypeConversion: '<S973>/DataType' */ |
| 15220 | L4_MABX_B.DataType_n1 = L4_MABX_B.Operator_ev; |
| 15221 | |
| 15222 | /* S-Function (sfix_bitop): '<S974>/Operator' */ |
| 15223 | L4_MABX_B.Operator_ms = (uint8_T)(L4_MABX_B.DataTypeConversion_ng & |
| 15224 | L4_MABX_P.Operator_BitMask_ak); |
| 15225 | |
| 15226 | /* DataTypeConversion: '<S974>/DataType' */ |
| 15227 | L4_MABX_B.DataType_f = L4_MABX_B.Operator_ms; |
| 15228 | |
| 15229 | /* S-Function (sfix_bitop): '<S975>/Operator' */ |
| 15230 | L4_MABX_B.Operator_h1 = (uint8_T)(L4_MABX_B.DataTypeConversion_ng & |
| 15231 | L4_MABX_P.Operator_BitMask_cz); |
| 15232 | |
| 15233 | /* DataTypeConversion: '<S975>/DataType' */ |
| 15234 | L4_MABX_B.DataType_oh = L4_MABX_B.Operator_h1; |
| 15235 | |
| 15236 | /* S-Function (sfix_bitop): '<S976>/Operator' */ |
| 15237 | L4_MABX_B.Operator_iz = (uint8_T)(L4_MABX_B.DataTypeConversion_ng & |
| 15238 | L4_MABX_P.Operator_BitMask_c2); |
| 15239 | |
| 15240 | /* DataTypeConversion: '<S976>/DataType' */ |
| 15241 | L4_MABX_B.DataType_p3 = L4_MABX_B.Operator_iz; |
| 15242 | |
| 15243 | /* S-Function (sfix_bitop): '<S978>/Operator' */ |
| 15244 | L4_MABX_B.Operator_iy = (uint8_T)(L4_MABX_B.DataTypeConversion_ng & |
| 15245 | L4_MABX_P.Operator_BitMask_au); |
| 15246 | |
| 15247 | /* DataTypeConversion: '<S978>/DataType' */ |
| 15248 | L4_MABX_B.DataType_m = L4_MABX_B.Operator_iy; |
| 15249 | |
| 15250 | /* DataTypeConversion: '<S949>/Data Type Conversion1' */ |
| 15251 | L4_MABX_B.DataTypeConversion1_nr = (L4_MABX_B.DataType_n1 != 0); |
| 15252 | |
| 15253 | /* ArithShift: '<S949>/Shift_Arithmetic ' */ |
| 15254 | L4_MABX_B.Shift_Arithmetic_j = ldexp(L4_MABX_B.DataType_f, (-1)); |
| 15255 | |
| 15256 | /* DataTypeConversion: '<S949>/Data Type Conversion3' */ |
| 15257 | L4_MABX_B.DataTypeConversion3_f2 = (L4_MABX_B.Shift_Arithmetic_j != 0.0); |
| 15258 | |
| 15259 | /* ArithShift: '<S949>/Shift_Arithmetic 1' */ |
| 15260 | L4_MABX_B.Shift_Arithmetic1_k = ldexp(L4_MABX_B.DataType_oh, (-2)); |
| 15261 | |
| 15262 | /* DataTypeConversion: '<S949>/Data Type Conversion4' */ |
| 15263 | L4_MABX_B.DataTypeConversion4_ox = (L4_MABX_B.Shift_Arithmetic1_k != 0.0); |
| 15264 | |
| 15265 | /* ArithShift: '<S949>/Shift_Arithmetic 2' */ |
| 15266 | L4_MABX_B.Shift_Arithmetic2_m = ldexp(L4_MABX_B.DataType_p3, (-3)); |
| 15267 | |
| 15268 | /* DataTypeConversion: '<S949>/Data Type Conversion5' */ |
| 15269 | L4_MABX_B.DataTypeConversion5_me = (L4_MABX_B.Shift_Arithmetic2_m != 0.0); |
| 15270 | |
| 15271 | /* ArithShift: '<S949>/Shift_Arithmetic 4' */ |
| 15272 | L4_MABX_B.Shift_Arithmetic4_om = ldexp(L4_MABX_B.DataType_m, (-5)); |
| 15273 | |
| 15274 | /* DataTypeConversion: '<S949>/Data Type Conversion7' */ |
| 15275 | L4_MABX_B.DataTypeConversion7_ef = (L4_MABX_B.Shift_Arithmetic4_om != 0.0); |
| 15276 | |
| 15277 | /* Logic: '<S1010>/Logical Operator1' */ |
| 15278 | L4_MABX_B.LogicalOperator1_cr = !L4_MABX_B.Operator_MX; |
| 15279 | |
| 15280 | /* Logic: '<S1010>/Logical Operator' */ |
| 15281 | L4_MABX_B.LogicalOperator_i1 = (L4_MABX_B.LogicalOperator1_cr && |
| 15282 | L4_MABX_B.Operator_MN); |
| 15283 | |
| 15284 | /* RelationalOperator: '<S1014>/Operator' */ |
| 15285 | L4_MABX_B.Operator_k1o = (L4_MABX_B.Switch1_a == L4_MABX_B.Width_j); |
| 15286 | |
| 15287 | /* End of Outputs for SubSystem: '<S855>/CAN_TX_10ms' */ |
| 15288 | |
| 15289 | /* Outputs for Atomic SubSystem: '<S855>/CAN_TX_20ms' */ |
| 15290 | |
| 15291 | /* RateTransition: '<S1021>/TmpRTBAtDivide1Inport1' */ |
| 15292 | if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) { |
| 15293 | L4_MABX_B.BrakingPID_Y_g = L4_MABX_B.BrakingPID_Y_k; |
| 15294 | L4_MABX_B.AutonomousOutputEnabled_h = AutonomousOutputEnabled; |
| 15295 | L4_MABX_B.BrakingControlActive_b = L4_MABX_B.F_Brake_control_active; |
| 15296 | L4_MABX_B.TmpRTBAtLogicalOperator8Inport1 = AutonomousOutputEnabled; |
| 15297 | L4_MABX_B.TmpRTBAtLogicalOperator1Inport2 = AutonomousOutputEnabled; |
| 15298 | L4_MABX_B.TmpRTBAtUnit_DelayInport1 = AutonomousOutputEnabled; |
| 15299 | L4_MABX_B.BrakingPID_Y_gc = L4_MABX_B.BrakingPID_Y_k; |
| 15300 | L4_MABX_B.FrontAxleSpeed_b = L4_MABX_B.SFunction1_o1_gd; |
| 15301 | L4_MABX_B.SPN1807_SteeringWheelAngle_g = SteerWheelAngle; |
| 15302 | L4_MABX_B.SPN1808_YawRate_i = YawRate; |
| 15303 | L4_MABX_B.SPN1810_LongitudinalAccelerat_i = SPN1810_LongitudinalAcceleration; |
| 15304 | } |
| 15305 | |
| 15306 | /* End of Outputs for SubSystem: '<S855>/CAN_TX_20ms' */ |
| 15307 | |
| 15308 | /* Outputs for Atomic SubSystem: '<S855>/CAN_TX_5000ms' */ |
| 15309 | |
| 15310 | /* RateTransition: '<S1050>/TmpRTBAtOperatorInport2' */ |
| 15311 | if (L4_MABX_M->Timing.RateInteraction.TID0_7 == 1) { |
| 15312 | L4_MABX_B.TmpRTBAtOperatorInport2 = AutonomousOutputEnabled; |
| 15313 | } |
| 15314 | |
| 15315 | /* End of RateTransition: '<S1050>/TmpRTBAtOperatorInport2' */ |
| 15316 | |
| 15317 | /* End of Outputs for SubSystem: '<S855>/CAN_TX_5000ms' */ |
| 15318 | |
| 15319 | /* Outputs for Enabled SubSystem: '<S646>/TC1_03_05' incorporates: |
| 15320 | * EnablePort: '<S647>/Enable' |
| 15321 | */ |
| 15322 | /* Constant: '<S461>/Constant' */ |
| 15323 | if (L4_MABX_P.Constant_Value_cu) { |
| 15324 | /* S-Function (rti_commonblock): '<S647>/S-Function1' */ |
| 15325 | /* This comment workarounds a code generation problem */ |
| 15326 | |
| 15327 | /* dSPACE RTICAN RX Message Block: "TC1_03_05" Id:201392901 */ |
| 15328 | { |
| 15329 | UInt32 *CAN_Msg; |
| 15330 | static dsfloat time_old = 0.0; |
| 15331 | |
| 15332 | /* Read status and timestamp info (previous message) */ |
| 15333 | if (can_type1_M3_C1_XTD[CANTP1_M3_C1_RXSRVC_XTD_0xC010305].timestamp != |
| 15334 | time_old) { |
| 15335 | /* ... save timestamp info for the calculation of the RX status |
| 15336 | during the consecutive sample hit*/ |
| 15337 | time_old = can_type1_M3_C1_XTD[CANTP1_M3_C1_RXSRVC_XTD_0xC010305]. |
| 15338 | timestamp; |
| 15339 | |
| 15340 | /* ... set the processed flag to one */ |
| 15341 | L4_MABX_B.SFunction1_o26 = 1.0; |
| 15342 | L4_MABX_B.SFunction1_o27 = (real_T) |
| 15343 | can_type1_M3_C1_XTD[CANTP1_M3_C1_RXSRVC_XTD_0xC010305].timestamp; |
| 15344 | L4_MABX_B.SFunction1_o28 = (real_T) |
| 15345 | can_type1_M3_C1_XTD[CANTP1_M3_C1_RXSRVC_XTD_0xC010305].deltatime; |
| 15346 | CAN_Msg = can_type1_M3_C1_XTD[CANTP1_M3_C1_RXSRVC_XTD_0xC010305].data; |
| 15347 | |
| 15348 | /* Decode CAN message */ |
| 15349 | { |
| 15350 | { |
| 15351 | rtican_Signal_t CAN_Sgn; |
| 15352 | |
| 15353 | /* ...... "SPN681_TransGearShiftInhibitReq" (0|2, standard signal, unsigned int, little endian) */ |
| 15354 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 15355 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15356 | L4_MABX_B.SFunction1_o1_iz = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15357 | |
| 15358 | /* ...... "SPN682_TransTrqConvLockupDisReq" (2|2, standard signal, unsigned int, little endian) */ |
| 15359 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 15360 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 15361 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15362 | L4_MABX_B.SFunction1_o2_k5 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15363 | |
| 15364 | /* ...... "SPN683_DisengageDrivelineReq" (4|2, standard signal, unsigned int, little endian) */ |
| 15365 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 15366 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 15367 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15368 | L4_MABX_B.SFunction1_o3_edr = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15369 | |
| 15370 | /* ...... "SPN4242_TransRevGearShiftInhibRq" (6|2, standard signal, unsigned int, little endian) */ |
| 15371 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 15372 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 15373 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15374 | L4_MABX_B.SFunction1_o4_lb = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15375 | |
| 15376 | /* ...... "SPN684_RequestedPercClutchSlip" (8|8, standard signal, unsigned int, little endian) */ |
| 15377 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 15378 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15379 | L4_MABX_B.SFunction1_o5_n = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 15380 | |
| 15381 | /* ...... "SPN525_TransRequestedGear" (16|8, standard signal, unsigned int, little endian) */ |
| 15382 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 15383 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15384 | L4_MABX_B.SFunction1_o6_b = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 15385 | |
| 15386 | /* ...... "SPN685_DisengageDiffLockRqFrAx1" (24|2, standard signal, unsigned int, little endian) */ |
| 15387 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 15388 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15389 | L4_MABX_B.SFunction1_o7_c = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15390 | |
| 15391 | /* ...... "SPN686_DisengageDiffLockRqFrAx2" (26|2, standard signal, unsigned int, little endian) */ |
| 15392 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 15393 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 15394 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15395 | L4_MABX_B.SFunction1_o8_l = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15396 | |
| 15397 | /* ...... "SPN687_DisengageDiffLockRqRrAx1" (28|2, standard signal, unsigned int, little endian) */ |
| 15398 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 15399 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 15400 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15401 | L4_MABX_B.SFunction1_o9_j = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15402 | |
| 15403 | /* ...... "SPN688_DisengageDiffLockRqRrAx2" (30|2, standard signal, unsigned int, little endian) */ |
| 15404 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 15405 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 15406 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15407 | L4_MABX_B.SFunction1_o10_h = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15408 | |
| 15409 | /* ...... "SPN689_DisengageDiffLockRqC" (32|2, standard signal, unsigned int, little endian) */ |
| 15410 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 15411 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15412 | L4_MABX_B.SFunction1_o11 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15413 | |
| 15414 | /* ...... "SPN690_DisengageDiffLockRqCF" (34|2, standard signal, unsigned int, little endian) */ |
| 15415 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 15416 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 15417 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15418 | L4_MABX_B.SFunction1_o12 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15419 | |
| 15420 | /* ...... "SPN691_DisengageDiffLockRqCR" (36|2, standard signal, unsigned int, little endian) */ |
| 15421 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 15422 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 15423 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15424 | L4_MABX_B.SFunction1_o13 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15425 | |
| 15426 | /* ...... "SPN5762_TransLoadRedInhibitRq" (38|2, standard signal, unsigned int, little endian) */ |
| 15427 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 15428 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 15429 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15430 | L4_MABX_B.SFunction1_o14 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15431 | |
| 15432 | /* ...... "SPN1852_TransmissionMode1" (40|2, standard signal, unsigned int, little endian) */ |
| 15433 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 15434 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15435 | L4_MABX_B.SFunction1_o15 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15436 | |
| 15437 | /* ...... "SPN1853_TransmissionMode2" (42|2, standard signal, unsigned int, little endian) */ |
| 15438 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 15439 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 15440 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15441 | L4_MABX_B.SFunction1_o16 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15442 | |
| 15443 | /* ...... "SPN1854_TransmissionMode3" (44|2, standard signal, unsigned int, little endian) */ |
| 15444 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 15445 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 15446 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15447 | L4_MABX_B.SFunction1_o17 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15448 | |
| 15449 | /* ...... "SPN1855_TransmissionMode4" (46|2, standard signal, unsigned int, little endian) */ |
| 15450 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 15451 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 15452 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15453 | L4_MABX_B.SFunction1_o18 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15454 | |
| 15455 | /* ...... "SPN7695_TransAutoNeutralRequest" (48|2, standard signal, unsigned int, little endian) */ |
| 15456 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 15457 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15458 | L4_MABX_B.SFunction1_o19 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15459 | |
| 15460 | /* ...... "SPN4255_TransRequestedLaunchGear" (50|4, standard signal, unsigned int, little endian) */ |
| 15461 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 15462 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 15463 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 15464 | L4_MABX_B.SFunction1_o20 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15465 | |
| 15466 | /* ...... "SPN2985_TransShiftSelDispModeSw" (54|2, standard signal, unsigned int, little endian) */ |
| 15467 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 15468 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 15469 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15470 | L4_MABX_B.SFunction1_o21 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15471 | |
| 15472 | /* ...... "SPN4246_TransmissionMode5" (56|2, standard signal, unsigned int, little endian) */ |
| 15473 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 15474 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15475 | L4_MABX_B.SFunction1_o22 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15476 | |
| 15477 | /* ...... "SPN4247_TransmissionMode6" (58|2, standard signal, unsigned int, little endian) */ |
| 15478 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 15479 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 15480 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15481 | L4_MABX_B.SFunction1_o23 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15482 | |
| 15483 | /* ...... "SPN4248_TransmissionMode7" (60|2, standard signal, unsigned int, little endian) */ |
| 15484 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 15485 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 15486 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15487 | L4_MABX_B.SFunction1_o24 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15488 | |
| 15489 | /* ...... "SPN4249_TransmissionMode8" (62|2, standard signal, unsigned int, little endian) */ |
| 15490 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 15491 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 15492 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15493 | L4_MABX_B.SFunction1_o25 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15494 | } |
| 15495 | } |
| 15496 | } else { |
| 15497 | /* set RX status to 0 because no new message has arrived */ |
| 15498 | L4_MABX_B.SFunction1_o26 = 0.0; |
| 15499 | } |
| 15500 | } |
| 15501 | } |
| 15502 | |
| 15503 | /* End of Constant: '<S461>/Constant' */ |
| 15504 | /* End of Outputs for SubSystem: '<S646>/TC1_03_05' */ |
| 15505 | |
| 15506 | /* Outputs for Atomic SubSystem: '<S855>/CAN_TX_50ms' */ |
| 15507 | |
| 15508 | /* RateTransition: '<S1060>/TmpRTBAtCCVS1_E3Inport1' */ |
| 15509 | if (L4_MABX_M->Timing.RateInteraction.TID0_2 == 1) { |
| 15510 | L4_MABX_B.TwoSpeedAxleSwitch = L4_MABX_B.SFunction1_o1_g3; |
| 15511 | L4_MABX_B.ParkingBrakeSwitch = L4_MABX_B.SFunction1_o2_g4; |
| 15512 | L4_MABX_B.CruiseCtrlPauseSwitch = L4_MABX_B.SFunction1_o3_ne; |
| 15513 | L4_MABX_B.ParkBrakeReleaseInhibitRq = L4_MABX_B.SFunction1_o4_e3; |
| 15514 | L4_MABX_B.WheelBasedVehicleSpeed_p = WheelBasedVehicleSpeed; |
| 15515 | L4_MABX_B.CruiseCtrlActive = L4_MABX_B.SFunction1_o6_oc; |
| 15516 | L4_MABX_B.CruiseCtrlEnableSwitch_n = L4_MABX_B.SFunction1_o7_dk; |
| 15517 | L4_MABX_B.BrakeSwitch_n = BrakeSwitch; |
| 15518 | L4_MABX_B.ClutchSwitch = L4_MABX_B.SFunction1_o9_p; |
| 15519 | L4_MABX_B.CruiseCtrlSetSwitch = L4_MABX_B.SFunction1_o10_or; |
| 15520 | L4_MABX_B.CruiseCtrlCoastSwitch = L4_MABX_B.SFunction1_o11_ae; |
| 15521 | L4_MABX_B.CruiseCtrlResumeSwitch = L4_MABX_B.SFunction1_o12_jy; |
| 15522 | L4_MABX_B.CruiseCtrlAccelerateSwitch = L4_MABX_B.SFunction1_o13_ou; |
| 15523 | L4_MABX_B.CruiseCtrlSetSpeed = L4_MABX_B.SFunction1_o14_b; |
| 15524 | L4_MABX_B.PTOGovernorState = L4_MABX_B.SFunction1_o15_dd; |
| 15525 | L4_MABX_B.CruiseCtrlStates = L4_MABX_B.SFunction1_o16_g; |
| 15526 | L4_MABX_B.EngIdleIncrementSwitch = L4_MABX_B.SFunction1_o17_n; |
| 15527 | L4_MABX_B.EngIdleDecrementSwitch = L4_MABX_B.SFunction1_o18_g; |
| 15528 | L4_MABX_B.EngTestModeSwitch = L4_MABX_B.SFunction1_o19_a; |
| 15529 | L4_MABX_B.EngShutdownOverrideSwitch = L4_MABX_B.SFunction1_o20_ir; |
| 15530 | L4_MABX_B.SPN681_TransGearShiftInhibitReq = L4_MABX_B.SFunction1_o1_iz; |
| 15531 | L4_MABX_B.SPN682_TransTrqConvLockupDisReq = L4_MABX_B.SFunction1_o2_k5; |
| 15532 | L4_MABX_B.SPN683_DisengageDrivelineReq = L4_MABX_B.SFunction1_o3_edr; |
| 15533 | L4_MABX_B.SPN4242_TransRevGearShiftInhibR = L4_MABX_B.SFunction1_o4_lb; |
| 15534 | L4_MABX_B.SPN684_RequestedPercClutchSlip = L4_MABX_B.SFunction1_o5_n; |
| 15535 | L4_MABX_B.SPN525_TransRequestedGear = L4_MABX_B.SFunction1_o6_b; |
| 15536 | L4_MABX_B.SPN685_DisengageDiffLockRqFrAx1 = L4_MABX_B.SFunction1_o7_c; |
| 15537 | L4_MABX_B.SPN686_DisengageDiffLockRqFrAx2 = L4_MABX_B.SFunction1_o8_l; |
| 15538 | L4_MABX_B.SPN687_DisengageDiffLockRqRrAx1 = L4_MABX_B.SFunction1_o9_j; |
| 15539 | L4_MABX_B.SPN688_DisengageDiffLockRqRrAx2 = L4_MABX_B.SFunction1_o10_h; |
| 15540 | L4_MABX_B.SPN689_DisengageDiffLockRqC = L4_MABX_B.SFunction1_o11; |
| 15541 | L4_MABX_B.SPN690_DisengageDiffLockRqCF = L4_MABX_B.SFunction1_o12; |
| 15542 | L4_MABX_B.SPN691_DisengageDiffLockRqCR = L4_MABX_B.SFunction1_o13; |
| 15543 | L4_MABX_B.SPN5762_TransLoadRedInhibitRq = L4_MABX_B.SFunction1_o14; |
| 15544 | L4_MABX_B.SPN1852_TransmissionMode1 = L4_MABX_B.SFunction1_o15; |
| 15545 | L4_MABX_B.SPN1853_TransmissionMode2 = L4_MABX_B.SFunction1_o16; |
| 15546 | L4_MABX_B.SPN1854_TransmissionMode3 = L4_MABX_B.SFunction1_o17; |
| 15547 | L4_MABX_B.SPN1855_TransmissionMode4 = L4_MABX_B.SFunction1_o18; |
| 15548 | L4_MABX_B.SPN7695_TransAutoNeutralRequest = L4_MABX_B.SFunction1_o19; |
| 15549 | L4_MABX_B.SPN4255_TransRequestedLaunchGea = L4_MABX_B.SFunction1_o20; |
| 15550 | L4_MABX_B.SPN2985_TransShiftSelDispModeSw = L4_MABX_B.SFunction1_o21; |
| 15551 | L4_MABX_B.SPN4246_TransmissionMode5 = L4_MABX_B.SFunction1_o22; |
| 15552 | L4_MABX_B.SPN4247_TransmissionMode6 = L4_MABX_B.SFunction1_o23; |
| 15553 | L4_MABX_B.SPN4248_TransmissionMode7 = L4_MABX_B.SFunction1_o24; |
| 15554 | L4_MABX_B.SPN4249_TransmissionMode8 = L4_MABX_B.SFunction1_o25; |
| 15555 | } |
| 15556 | |
| 15557 | /* End of Outputs for SubSystem: '<S855>/CAN_TX_50ms' */ |
| 15558 | |
| 15559 | /* Outputs for Enabled SubSystem: '<S644>/SystemTime_01' incorporates: |
| 15560 | * EnablePort: '<S645>/Enable' |
| 15561 | */ |
| 15562 | /* Constant: '<S460>/Constant' */ |
| 15563 | if (L4_MABX_P.Constant_Value_ix > 0.0) { |
| 15564 | /* S-Function (rti_commonblock): '<S645>/S-Function1' */ |
| 15565 | /* This comment workarounds a code generation problem */ |
| 15566 | |
| 15567 | /* dSPACE RTICAN RX Message Block: "SystemTime_01" Id:233836544 */ |
| 15568 | { |
| 15569 | UInt32 *CAN_Msg; |
| 15570 | static dsfloat time_old = 0.0; |
| 15571 | |
| 15572 | /* Read status and timestamp info (previous message) */ |
| 15573 | if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0xDF01000].timestamp != |
| 15574 | time_old) { |
| 15575 | /* ... save timestamp info for the calculation of the RX status |
| 15576 | during the consecutive sample hit*/ |
| 15577 | time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0xDF01000]. |
| 15578 | timestamp; |
| 15579 | |
| 15580 | /* ... set the processed flag to one */ |
| 15581 | L4_MABX_B.SFunction1_o5_g = 1.0; |
| 15582 | L4_MABX_B.SFunction1_o6_k = (real_T) |
| 15583 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0xDF01000].timestamp; |
| 15584 | L4_MABX_B.SFunction1_o7_e = (real_T) |
| 15585 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0xDF01000].deltatime; |
| 15586 | CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0xDF01000].data; |
| 15587 | |
| 15588 | /* Decode CAN message */ |
| 15589 | { |
| 15590 | { |
| 15591 | rtican_Signal_t CAN_Sgn; |
| 15592 | |
| 15593 | /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */ |
| 15594 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 15595 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15596 | L4_MABX_B.SFunction1_o1_os = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15597 | |
| 15598 | /* ...... "Source" (8|4, standard signal, unsigned int, little endian) */ |
| 15599 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 15600 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 15601 | L4_MABX_B.SFunction1_o2_ly = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15602 | |
| 15603 | /* ...... "Date" (16|16, standard signal, unsigned int, little endian) */ |
| 15604 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 15605 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 15606 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 15607 | L4_MABX_B.SFunction1_o3_g = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15608 | |
| 15609 | /* ...... "Time" (32|32, standard signal, unsigned int, little endian) */ |
| 15610 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 15611 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 15612 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[6]; |
| 15613 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[7]; |
| 15614 | L4_MABX_B.SFunction1_o4_hf = 0.0001 * ( ((real_T) |
| 15615 | CAN_Sgn.UnsignedSgn) ); |
| 15616 | } |
| 15617 | } |
| 15618 | } else { |
| 15619 | /* set RX status to 0 because no new message has arrived */ |
| 15620 | L4_MABX_B.SFunction1_o5_g = 0.0; |
| 15621 | } |
| 15622 | } |
| 15623 | } |
| 15624 | |
| 15625 | /* End of Constant: '<S460>/Constant' */ |
| 15626 | /* End of Outputs for SubSystem: '<S644>/SystemTime_01' */ |
| 15627 | |
| 15628 | /* DataTypeConversion: '<S644>/Data Type Conversion8' */ |
| 15629 | L4_MABX_B.RX_status_g = (L4_MABX_B.SFunction1_o5_g != 0.0); |
| 15630 | |
| 15631 | /* Logic: '<S1074>/Operator' incorporates: |
| 15632 | * Constant: '<S1072>/Constant' |
| 15633 | */ |
| 15634 | L4_MABX_B.Operator_fh = (L4_MABX_P.Constant_Value_cr && L4_MABX_B.RX_status_g); |
| 15635 | |
| 15636 | /* DataTypeConversion: '<S1074>/DataType' */ |
| 15637 | L4_MABX_B.DataType_kox = L4_MABX_B.Operator_fh; |
| 15638 | |
| 15639 | /* Outputs for Enabled SubSystem: '<S1073>/Std_SystemTime_01' incorporates: |
| 15640 | * EnablePort: '<S1075>/Enable' |
| 15641 | */ |
| 15642 | if (L4_MABX_B.DataType_kox) { |
| 15643 | /* S-Function (rti_commonblock): '<S1075>/S-Function1' incorporates: |
| 15644 | * Constant: '<S1073>/Constant' |
| 15645 | * Constant: '<S1073>/Constant1' |
| 15646 | */ |
| 15647 | /* This comment workarounds a code generation problem */ |
| 15648 | |
| 15649 | /* dSPACE RTICAN TX Message Block: "Std_SystemTime_01" Id:5 */ |
| 15650 | { |
| 15651 | static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 15652 | 0x00 }; |
| 15653 | |
| 15654 | Float32 delayTime = 0.0; |
| 15655 | |
| 15656 | /* link this pointer to CAN_Msg for use in initialize_io_units() */ |
| 15657 | CANTP1_PTR_M3_C2_STD_0x5 = &(CAN_Msg[0]); |
| 15658 | |
| 15659 | /* ... perform loop-back if required */ |
| 15660 | if (L4_MABX_P.Constant1_Value_bv > 0.5) { |
| 15661 | /* ... updating the used tx-clientbuffer */ |
| 15662 | can_tp1_msg_update_all( CANTP1_TX_M3_C2_MCRCLT_STD_0X5->module, |
| 15663 | CANTP1_TX_M3_C2_MCRCLT_STD_0X5->queue ); |
| 15664 | |
| 15665 | /* ... Read status and timestamp info perform loop-back (previous message) */ |
| 15666 | can_tp1_tx_msg_read_loopback(CANTP1_TX_M3_C2_MCRCLT_STD_0X5, |
| 15667 | 8, // datalen |
| 15668 | &(CAN_Msg[0]), |
| 15669 | CANTP1_RX_SPMSG_M3_C2_STD); |
| 15670 | |
| 15671 | /* Convert timestamp */ |
| 15672 | if (CANTP1_TX_M3_C2_MCRCLT_STD_0X5->processed) { |
| 15673 | CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp = |
| 15674 | rtk_dsts_time_to_simtime_convert |
| 15675 | (CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp); |
| 15676 | } |
| 15677 | } else { |
| 15678 | /* ... Read status and timestamp info (previous message) */ |
| 15679 | can_tp1_msg_read_from_dsmcr(CANTP1_TX_M3_C2_MCRCLT_STD_0X5); |
| 15680 | |
| 15681 | /* Convert timestamp */ |
| 15682 | if (CANTP1_TX_M3_C2_MCRCLT_STD_0X5->processed) { |
| 15683 | CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp = |
| 15684 | rtk_dsts_time_to_simtime_convert |
| 15685 | (CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp); |
| 15686 | } |
| 15687 | } |
| 15688 | |
| 15689 | /* Messages with timestamp zero have been received in pause/stop state |
| 15690 | and must not be handled. |
| 15691 | */ |
| 15692 | if (CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp > 0.0) { |
| 15693 | L4_MABX_B.SFunction1_o1_l = (real_T) |
| 15694 | CANTP1_TX_M3_C2_MCRCLT_STD_0X5->processed; |
| 15695 | L4_MABX_B.SFunction1_o2_d = (real_T) |
| 15696 | CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp; |
| 15697 | L4_MABX_B.SFunction1_o3 = (real_T) |
| 15698 | CANTP1_TX_M3_C2_MCRCLT_STD_0X5->deltatime; |
| 15699 | L4_MABX_B.SFunction1_o4 = (real_T) |
| 15700 | CANTP1_TX_M3_C2_MCRCLT_STD_0X5->delaytime; |
| 15701 | } |
| 15702 | |
| 15703 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 15704 | { |
| 15705 | rtican_Signal_t CAN_Sgn; |
| 15706 | UInt32 i; |
| 15707 | |
| 15708 | /* Initialize the static message data to zero */ |
| 15709 | for (i=0; i<8; i++ ) |
| 15710 | CAN_Msg[i] = 0; |
| 15711 | |
| 15712 | /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */ |
| 15713 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15714 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o1_os ) + 0.5); |
| 15715 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15716 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 15717 | |
| 15718 | /* ...... "Source" (8|4, standard signal, unsigned int, little endian) */ |
| 15719 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15720 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o2_ly ) + 0.5); |
| 15721 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 15722 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 15723 | |
| 15724 | /* ...... "Date" (16|16, standard signal, unsigned int, little endian) */ |
| 15725 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15726 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o3_g ) + 0.5); |
| 15727 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 15728 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 15729 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte1; |
| 15730 | |
| 15731 | /* ...... "Time" (32|32, standard signal, unsigned int, little endian) */ |
| 15732 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15733 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o4_hf - ( 0 ) ) / |
| 15734 | 0.0001 + 0.5); |
| 15735 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 15736 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte1; |
| 15737 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte2; |
| 15738 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte3; |
| 15739 | } |
| 15740 | |
| 15741 | delayTime = (Float32) L4_MABX_P.Constant_Value_g1 / (2000); |
| 15742 | |
| 15743 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 15744 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X5], 8, &(CAN_Msg[0]), |
| 15745 | delayTime); |
| 15746 | } |
| 15747 | } |
| 15748 | |
| 15749 | /* End of Outputs for SubSystem: '<S1073>/Std_SystemTime_01' */ |
| 15750 | |
| 15751 | /* Constant: '<S1064>/Byte1' */ |
| 15752 | L4_MABX_B.VectorConcatenate[0] = L4_MABX_P.Byte1_Value_g; |
| 15753 | |
| 15754 | /* Constant: '<S1064>/Byte2' */ |
| 15755 | L4_MABX_B.VectorConcatenate[1] = L4_MABX_P.Byte2_Value_h; |
| 15756 | |
| 15757 | /* Constant: '<S1064>/Byte3' */ |
| 15758 | L4_MABX_B.VectorConcatenate[2] = L4_MABX_P.Byte3_Value_b; |
| 15759 | |
| 15760 | /* Constant: '<S1064>/Byte4' */ |
| 15761 | L4_MABX_B.VectorConcatenate[3] = L4_MABX_P.Byte4_Value_a; |
| 15762 | |
| 15763 | /* Constant: '<S1064>/Byte5' */ |
| 15764 | L4_MABX_B.VectorConcatenate[4] = L4_MABX_P.Byte5_Value_m; |
| 15765 | |
| 15766 | /* Constant: '<S1064>/Byte6' */ |
| 15767 | L4_MABX_B.VectorConcatenate[5] = L4_MABX_P.Byte6_Value_b; |
| 15768 | |
| 15769 | /* Constant: '<S1064>/Byte7' */ |
| 15770 | L4_MABX_B.VectorConcatenate[6] = L4_MABX_P.Byte7_Value_e; |
| 15771 | |
| 15772 | /* Constant: '<S1064>/Byte8' */ |
| 15773 | L4_MABX_B.VectorConcatenate[7] = L4_MABX_P.Byte8_Value_av; |
| 15774 | |
| 15775 | /* DataTypeConversion: '<S1068>/Data Type Conversion' */ |
| 15776 | for (i = 0; i < 8; i++) { |
| 15777 | L4_MABX_B.DataTypeConversion[i] = L4_MABX_B.VectorConcatenate[i]; |
| 15778 | } |
| 15779 | |
| 15780 | /* End of DataTypeConversion: '<S1068>/Data Type Conversion' */ |
| 15781 | |
| 15782 | /* UnitDelay: '<S865>/Unit Delay2' */ |
| 15783 | L4_MABX_B.UnitDelay2 = L4_MABX_DW.UnitDelay2_DSTATE; |
| 15784 | |
| 15785 | /* Outputs for Triggered SubSystem: '<S1068>/CAN_TYPE1_TX_M1_C1' incorporates: |
| 15786 | * TriggerPort: '<S1070>/Trigger' |
| 15787 | */ |
| 15788 | zcEvent = (L4_MABX_B.UnitDelay2 && |
| 15789 | (L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE_n != POS_ZCSIG)); |
| 15790 | if (zcEvent) { |
| 15791 | /* S-Function (rti_commonblock): '<S1070>/S-Function1' */ |
| 15792 | /* This comment workarounds a code generation problem */ |
| 15793 | |
| 15794 | /* dSPACE RTICAN TX Message Block: "TX Message" Id:418184965 */ |
| 15795 | { |
| 15796 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 15797 | |
| 15798 | Float32 delayTime = 0.0; |
| 15799 | |
| 15800 | /* ... Read status and timestamp info (previous message) */ |
| 15801 | can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]); |
| 15802 | |
| 15803 | /* Convert timestamp */ |
| 15804 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->processed) { |
| 15805 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->timestamp = |
| 15806 | rtk_dsts_time_to_simtime_convert |
| 15807 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->timestamp); |
| 15808 | } |
| 15809 | |
| 15810 | /* Messages with timestamp zero have been received in pause/stop state |
| 15811 | and must not be handled. |
| 15812 | */ |
| 15813 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->timestamp > 0.0) { |
| 15814 | L4_MABX_B.SFunction1_o1_o = (real_T) |
| 15815 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->processed; |
| 15816 | L4_MABX_B.SFunction1_o2_a = (real_T) |
| 15817 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->timestamp; |
| 15818 | L4_MABX_B.SFunction1_o3_c = (real_T) |
| 15819 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->deltatime; |
| 15820 | L4_MABX_B.SFunction1_o4_l = (real_T) |
| 15821 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->delaytime; |
| 15822 | } |
| 15823 | |
| 15824 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 15825 | { |
| 15826 | rtican_Signal_t CAN_Sgn; |
| 15827 | |
| 15828 | /* ...... "Byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 15829 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15830 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[0] ) + |
| 15831 | 0.5); |
| 15832 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15833 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 15834 | |
| 15835 | /* ...... "Byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 15836 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15837 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[1] ) + |
| 15838 | 0.5); |
| 15839 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15840 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 15841 | |
| 15842 | /* ...... "Byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 15843 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15844 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[2] ) + |
| 15845 | 0.5); |
| 15846 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15847 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 15848 | |
| 15849 | /* ...... "Byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 15850 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15851 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[3] ) + |
| 15852 | 0.5); |
| 15853 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15854 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 15855 | |
| 15856 | /* ...... "Byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 15857 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15858 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[4] ) + |
| 15859 | 0.5); |
| 15860 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15861 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 15862 | |
| 15863 | /* ...... "Byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 15864 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15865 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[5] ) + |
| 15866 | 0.5); |
| 15867 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15868 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 15869 | |
| 15870 | /* ...... "Byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 15871 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15872 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[6] ) + |
| 15873 | 0.5); |
| 15874 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15875 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 15876 | |
| 15877 | /* ...... "Byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 15878 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15879 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[7] ) + |
| 15880 | 0.5); |
| 15881 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15882 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 15883 | } |
| 15884 | |
| 15885 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 15886 | can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05], 8, |
| 15887 | &(CAN_Msg[0]), delayTime); |
| 15888 | } |
| 15889 | } |
| 15890 | |
| 15891 | L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE_n = L4_MABX_B.UnitDelay2; |
| 15892 | |
| 15893 | /* End of Outputs for SubSystem: '<S1068>/CAN_TYPE1_TX_M1_C1' */ |
| 15894 | |
| 15895 | /* UnitDelay: '<S865>/Unit Delay1' */ |
| 15896 | L4_MABX_B.UnitDelay1_f4 = L4_MABX_DW.UnitDelay1_DSTATE_mt; |
| 15897 | |
| 15898 | /* MultiPortSwitch: '<S865>/Multiport Switch' incorporates: |
| 15899 | * Constant: '<S1066>/Byte1' |
| 15900 | * Constant: '<S1066>/Byte2' |
| 15901 | * Constant: '<S1066>/Byte3' |
| 15902 | * Constant: '<S1066>/Byte4' |
| 15903 | * Constant: '<S1066>/Byte5' |
| 15904 | * Constant: '<S1066>/Byte6' |
| 15905 | * Constant: '<S1066>/Byte7' |
| 15906 | * Constant: '<S1066>/Byte8' |
| 15907 | * Constant: '<S1067>/Byte1' |
| 15908 | * Constant: '<S1067>/Byte2' |
| 15909 | * Constant: '<S1067>/Byte3' |
| 15910 | * Constant: '<S1067>/Byte4' |
| 15911 | * Constant: '<S1067>/Byte5' |
| 15912 | * Constant: '<S1067>/Byte6' |
| 15913 | * Constant: '<S1067>/Byte7' |
| 15914 | * Constant: '<S1067>/Byte8' |
| 15915 | */ |
| 15916 | if (L4_MABX_B.UnitDelay1_f4 == 1) { |
| 15917 | L4_MABX_B.VectorConcatenate_p[7] = L4_MABX_P.Byte8_Value_a; |
| 15918 | L4_MABX_B.VectorConcatenate_p[6] = L4_MABX_P.Byte7_Value_o; |
| 15919 | L4_MABX_B.VectorConcatenate_p[5] = L4_MABX_P.Byte6_Value_n; |
| 15920 | L4_MABX_B.VectorConcatenate_p[4] = L4_MABX_P.Byte5_Value_n; |
| 15921 | L4_MABX_B.VectorConcatenate_p[3] = L4_MABX_P.Byte4_Value_g; |
| 15922 | L4_MABX_B.VectorConcatenate_p[2] = L4_MABX_P.Byte3_Value_a; |
| 15923 | L4_MABX_B.VectorConcatenate_p[1] = L4_MABX_P.Byte2_Value_i; |
| 15924 | L4_MABX_B.VectorConcatenate_p[0] = L4_MABX_P.Byte1_Value_h; |
| 15925 | for (i = 0; i < 8; i++) { |
| 15926 | L4_MABX_B.MultiportSwitch_l[i] = L4_MABX_B.VectorConcatenate_p[i]; |
| 15927 | } |
| 15928 | } else { |
| 15929 | L4_MABX_B.VectorConcatenate_n[7] = L4_MABX_P.Byte8_Value; |
| 15930 | L4_MABX_B.VectorConcatenate_n[6] = L4_MABX_P.Byte7_Value; |
| 15931 | L4_MABX_B.VectorConcatenate_n[5] = L4_MABX_P.Byte6_Value; |
| 15932 | L4_MABX_B.VectorConcatenate_n[4] = L4_MABX_P.Byte5_Value; |
| 15933 | L4_MABX_B.VectorConcatenate_n[3] = L4_MABX_P.Byte4_Value; |
| 15934 | L4_MABX_B.VectorConcatenate_n[2] = L4_MABX_P.Byte3_Value; |
| 15935 | L4_MABX_B.VectorConcatenate_n[1] = L4_MABX_P.Byte2_Value; |
| 15936 | L4_MABX_B.VectorConcatenate_n[0] = L4_MABX_P.Byte1_Value; |
| 15937 | for (i = 0; i < 8; i++) { |
| 15938 | L4_MABX_B.MultiportSwitch_l[i] = L4_MABX_B.VectorConcatenate_n[i]; |
| 15939 | } |
| 15940 | } |
| 15941 | |
| 15942 | /* End of MultiPortSwitch: '<S865>/Multiport Switch' */ |
| 15943 | |
| 15944 | /* DataTypeConversion: '<S1069>/Data Type Conversion' */ |
| 15945 | for (i = 0; i < 8; i++) { |
| 15946 | L4_MABX_B.DataTypeConversion_d[i] = L4_MABX_B.MultiportSwitch_l[i]; |
| 15947 | } |
| 15948 | |
| 15949 | /* End of DataTypeConversion: '<S1069>/Data Type Conversion' */ |
| 15950 | |
| 15951 | /* UnitDelay: '<S865>/Unit Delay3' */ |
| 15952 | L4_MABX_B.UnitDelay3 = L4_MABX_DW.UnitDelay3_DSTATE; |
| 15953 | |
| 15954 | /* Outputs for Triggered SubSystem: '<S1069>/CAN_TYPE1_TX_M1_C1' incorporates: |
| 15955 | * TriggerPort: '<S1071>/Trigger' |
| 15956 | */ |
| 15957 | zcEvent = (L4_MABX_B.UnitDelay3 && |
| 15958 | (L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE != POS_ZCSIG)); |
| 15959 | if (zcEvent) { |
| 15960 | /* S-Function (rti_commonblock): '<S1071>/S-Function1' */ |
| 15961 | /* This comment workarounds a code generation problem */ |
| 15962 | |
| 15963 | /* dSPACE RTICAN TX Message Block: "TX Message" Id:418119429 */ |
| 15964 | { |
| 15965 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 15966 | |
| 15967 | Float32 delayTime = 0.0; |
| 15968 | |
| 15969 | /* ... Read status and timestamp info (previous message) */ |
| 15970 | can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]); |
| 15971 | |
| 15972 | /* Convert timestamp */ |
| 15973 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->processed) { |
| 15974 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->timestamp = |
| 15975 | rtk_dsts_time_to_simtime_convert |
| 15976 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->timestamp); |
| 15977 | } |
| 15978 | |
| 15979 | /* Messages with timestamp zero have been received in pause/stop state |
| 15980 | and must not be handled. |
| 15981 | */ |
| 15982 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->timestamp > 0.0) { |
| 15983 | L4_MABX_B.SFunction1_o1_j = (real_T) |
| 15984 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->processed; |
| 15985 | L4_MABX_B.SFunction1_o2_e = (real_T) |
| 15986 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->timestamp; |
| 15987 | L4_MABX_B.SFunction1_o3_l = (real_T) |
| 15988 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->deltatime; |
| 15989 | L4_MABX_B.SFunction1_o4_a = (real_T) |
| 15990 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->delaytime; |
| 15991 | } |
| 15992 | |
| 15993 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 15994 | { |
| 15995 | rtican_Signal_t CAN_Sgn; |
| 15996 | |
| 15997 | /* ...... "Byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 15998 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15999 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_d[0] ) + |
| 16000 | 0.5); |
| 16001 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 16002 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 16003 | |
| 16004 | /* ...... "Byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 16005 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 16006 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_d[1] ) + |
| 16007 | 0.5); |
| 16008 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 16009 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 16010 | |
| 16011 | /* ...... "Byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 16012 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 16013 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_d[2] ) + |
| 16014 | 0.5); |
| 16015 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 16016 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 16017 | |
| 16018 | /* ...... "Byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 16019 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 16020 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_d[3] ) + |
| 16021 | 0.5); |
| 16022 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 16023 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 16024 | |
| 16025 | /* ...... "Byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 16026 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 16027 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_d[4] ) + |
| 16028 | 0.5); |
| 16029 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 16030 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 16031 | |
| 16032 | /* ...... "Byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 16033 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 16034 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_d[5] ) + |
| 16035 | 0.5); |
| 16036 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 16037 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 16038 | |
| 16039 | /* ...... "Byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 16040 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 16041 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_d[6] ) + |
| 16042 | 0.5); |
| 16043 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 16044 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 16045 | |
| 16046 | /* ...... "Byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 16047 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 16048 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_d[7] ) + |
| 16049 | 0.5); |
| 16050 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 16051 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 16052 | } |
| 16053 | |
| 16054 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 16055 | can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05], 8, |
| 16056 | &(CAN_Msg[0]), delayTime); |
| 16057 | } |
| 16058 | } |
| 16059 | |
| 16060 | L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE = L4_MABX_B.UnitDelay3; |
| 16061 | |
| 16062 | /* End of Outputs for SubSystem: '<S1069>/CAN_TYPE1_TX_M1_C1' */ |
| 16063 | |
| 16064 | /* Chart: '<S865>/Chart' incorporates: |
| 16065 | * Constant: '<S865>/Constant1' |
| 16066 | */ |
| 16067 | if (L4_MABX_DW.temporalCounter_i1_m < 255U) { |
| 16068 | L4_MABX_DW.temporalCounter_i1_m++; |
| 16069 | } |
| 16070 | |
| 16071 | /* Gateway: OUTPUTS_PIC_KW/CAN_Out_PIC_KW/CAN_TX_BAM/Chart */ |
| 16072 | /* During: OUTPUTS_PIC_KW/CAN_Out_PIC_KW/CAN_TX_BAM/Chart */ |
| 16073 | if (L4_MABX_DW.is_active_c4_SUB_ECU_L4_MABX_HW == 0U) { |
| 16074 | /* Entry: OUTPUTS_PIC_KW/CAN_Out_PIC_KW/CAN_TX_BAM/Chart */ |
| 16075 | L4_MABX_DW.is_active_c4_SUB_ECU_L4_MABX_HW = 1U; |
| 16076 | |
| 16077 | /* Entry Internal: OUTPUTS_PIC_KW/CAN_Out_PIC_KW/CAN_TX_BAM/Chart */ |
| 16078 | /* Transition: '<S1065>:4' */ |
| 16079 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_Init_l; |
| 16080 | |
| 16081 | /* Entry 'Init': '<S1065>:1' */ |
| 16082 | L4_MABX_B.State = 0U; |
| 16083 | L4_MABX_B.enTPCM = false; |
| 16084 | L4_MABX_B.enTPDT = false; |
| 16085 | L4_MABX_B.TPCM_ts_Prev = L4_MABX_B.SFunction1_o2_a; |
| 16086 | L4_MABX_B.TPDT_ts_Prev = L4_MABX_B.SFunction1_o2_e; |
| 16087 | L4_MABX_B.TPDT_count = 0U; |
| 16088 | } else { |
| 16089 | switch (L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf) { |
| 16090 | case L4_MABX_IN_CheckPacketCount: |
| 16091 | L4_MABX_B.State = 6U; |
| 16092 | |
| 16093 | /* During 'CheckPacketCount': '<S1065>:11' */ |
| 16094 | if (L4_MABX_B.TPDT_count <= L4_MABX_P.Constant1_Value_jf) { |
| 16095 | /* Transition: '<S1065>:18' */ |
| 16096 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SendTPDT; |
| 16097 | L4_MABX_DW.temporalCounter_i1_m = 0U; |
| 16098 | |
| 16099 | /* Entry 'SendTPDT': '<S1065>:6' */ |
| 16100 | L4_MABX_B.State = 4U; |
| 16101 | L4_MABX_B.enTPDT = true; |
| 16102 | } else { |
| 16103 | /* Transition: '<S1065>:19' */ |
| 16104 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = |
| 16105 | L4_MABX_IN_WaitForNextPeriod; |
| 16106 | L4_MABX_DW.temporalCounter_i1_m = 0U; |
| 16107 | |
| 16108 | /* Entry 'WaitForNextPeriod': '<S1065>:17' */ |
| 16109 | L4_MABX_B.State = 7U; |
| 16110 | } |
| 16111 | break; |
| 16112 | |
| 16113 | case L4_MABX_IN_Init_l: |
| 16114 | /* During 'Init': '<S1065>:1' */ |
| 16115 | /* Transition: '<S1065>:9' */ |
| 16116 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_StartMsg; |
| 16117 | |
| 16118 | /* Entry 'StartMsg': '<S1065>:30' */ |
| 16119 | L4_MABX_B.State = 1U; |
| 16120 | L4_MABX_B.TPDT_count = 1U; |
| 16121 | break; |
| 16122 | |
| 16123 | case L4_MABX_IN_InterframeDelay: |
| 16124 | L4_MABX_B.State = 3U; |
| 16125 | |
| 16126 | /* During 'InterframeDelay': '<S1065>:7' */ |
| 16127 | if (L4_MABX_DW.temporalCounter_i1_m >= 5U) { |
| 16128 | /* Transition: '<S1065>:10' */ |
| 16129 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SendTPDT; |
| 16130 | L4_MABX_DW.temporalCounter_i1_m = 0U; |
| 16131 | |
| 16132 | /* Entry 'SendTPDT': '<S1065>:6' */ |
| 16133 | L4_MABX_B.State = 4U; |
| 16134 | L4_MABX_B.enTPDT = true; |
| 16135 | } |
| 16136 | break; |
| 16137 | |
| 16138 | case L4_MABX_IN_InterframeDelay1: |
| 16139 | L4_MABX_B.State = 5U; |
| 16140 | |
| 16141 | /* During 'InterframeDelay1': '<S1065>:12' */ |
| 16142 | if (L4_MABX_DW.temporalCounter_i1_m >= 5U) { |
| 16143 | /* Transition: '<S1065>:14' */ |
| 16144 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_CheckPacketCount; |
| 16145 | |
| 16146 | /* Entry 'CheckPacketCount': '<S1065>:11' */ |
| 16147 | L4_MABX_B.State = 6U; |
| 16148 | i = (int32_T)(L4_MABX_B.TPDT_count + 1U); |
| 16149 | if ((uint32_T)i > 255U) { |
| 16150 | i = 255; |
| 16151 | } |
| 16152 | |
| 16153 | L4_MABX_B.TPDT_count = (uint8_T)i; |
| 16154 | } |
| 16155 | break; |
| 16156 | |
| 16157 | case L4_MABX_IN_SendTPCM: |
| 16158 | L4_MABX_B.State = 2U; |
| 16159 | |
| 16160 | /* During 'SendTPCM': '<S1065>:5' */ |
| 16161 | if (L4_MABX_DW.temporalCounter_i1_m >= 1U) { |
| 16162 | /* Transition: '<S1065>:8' */ |
| 16163 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_InterframeDelay; |
| 16164 | L4_MABX_DW.temporalCounter_i1_m = 0U; |
| 16165 | |
| 16166 | /* Entry 'InterframeDelay': '<S1065>:7' */ |
| 16167 | L4_MABX_B.State = 3U; |
| 16168 | L4_MABX_B.enTPCM = false; |
| 16169 | L4_MABX_B.TPCM_ts_Prev = L4_MABX_B.SFunction1_o2_a; |
| 16170 | } |
| 16171 | break; |
| 16172 | |
| 16173 | case L4_MABX_IN_SendTPDT: |
| 16174 | L4_MABX_B.State = 4U; |
| 16175 | |
| 16176 | /* During 'SendTPDT': '<S1065>:6' */ |
| 16177 | if (L4_MABX_DW.temporalCounter_i1_m >= 1U) { |
| 16178 | /* Transition: '<S1065>:13' */ |
| 16179 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_InterframeDelay1; |
| 16180 | L4_MABX_DW.temporalCounter_i1_m = 0U; |
| 16181 | |
| 16182 | /* Entry 'InterframeDelay1': '<S1065>:12' */ |
| 16183 | L4_MABX_B.State = 5U; |
| 16184 | L4_MABX_B.enTPDT = false; |
| 16185 | L4_MABX_B.TPDT_ts_Prev = L4_MABX_B.SFunction1_o2_e; |
| 16186 | } |
| 16187 | break; |
| 16188 | |
| 16189 | case L4_MABX_IN_StartMsg: |
| 16190 | /* During 'StartMsg': '<S1065>:30' */ |
| 16191 | /* Transition: '<S1065>:31' */ |
| 16192 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SendTPCM; |
| 16193 | L4_MABX_DW.temporalCounter_i1_m = 0U; |
| 16194 | |
| 16195 | /* Entry 'SendTPCM': '<S1065>:5' */ |
| 16196 | L4_MABX_B.State = 2U; |
| 16197 | L4_MABX_B.enTPCM = true; |
| 16198 | break; |
| 16199 | |
| 16200 | default: |
| 16201 | L4_MABX_B.State = 7U; |
| 16202 | |
| 16203 | /* During 'WaitForNextPeriod': '<S1065>:17' */ |
| 16204 | if (L4_MABX_DW.temporalCounter_i1_m >= 185U) { |
| 16205 | /* Transition: '<S1065>:20' */ |
| 16206 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_StartMsg; |
| 16207 | |
| 16208 | /* Entry 'StartMsg': '<S1065>:30' */ |
| 16209 | L4_MABX_B.State = 1U; |
| 16210 | L4_MABX_B.TPDT_count = 1U; |
| 16211 | } |
| 16212 | break; |
| 16213 | } |
| 16214 | } |
| 16215 | |
| 16216 | /* End of Chart: '<S865>/Chart' */ |
| 16217 | |
| 16218 | /* RateTransition: '<S1083>/TmpRTBAtFlashOutport1' */ |
| 16219 | if (L4_MABX_M->Timing.RateInteraction.TID0_3 == 1) { |
| 16220 | L4_MABX_B.TmpRTBAtFlashOutport1 = L4_MABX_DW.TmpRTBAtFlashOutport1_Buffer0; |
| 16221 | } |
| 16222 | |
| 16223 | /* End of RateTransition: '<S1083>/TmpRTBAtFlashOutport1' */ |
| 16224 | |
| 16225 | /* RelationalOperator: '<S1091>/Operator' incorporates: |
| 16226 | * Constant: '<S1083>/Manual Ready' |
| 16227 | */ |
| 16228 | L4_MABX_B.Operator_cd = (L4_MABX_P.ManualReady_Value == SupervisorMode); |
| 16229 | |
| 16230 | /* Logic: '<S1083>/AND3' */ |
| 16231 | L4_MABX_B.AND3 = ((L4_MABX_B.TmpRTBAtFlashOutport1 != 0.0) && |
| 16232 | L4_MABX_B.Operator_cd); |
| 16233 | |
| 16234 | /* Logic: '<S1083>/NOT2' */ |
| 16235 | L4_MABX_B.NOT2 = !L4_MABX_B.Operator_cd; |
| 16236 | |
| 16237 | /* Logic: '<S1083>/OR1' */ |
| 16238 | L4_MABX_B.OR1_e = (L4_MABX_B.AND3 || L4_MABX_B.NOT2); |
| 16239 | |
| 16240 | /* Logic: '<S1083>/NOT1' */ |
| 16241 | L4_MABX_B.NOT1 = !L4_MABX_B.AutonomousEnabled_d; |
| 16242 | |
| 16243 | /* RelationalOperator: '<S1092>/Operator' incorporates: |
| 16244 | * Constant: '<S1083>/Constant2' |
| 16245 | */ |
| 16246 | L4_MABX_B.Operator_fz = (L4_MABX_P.Constant2_Value_mw == MABX_Mode); |
| 16247 | |
| 16248 | /* Logic: '<S1083>/NOT' */ |
| 16249 | L4_MABX_B.NOT_o = !L4_MABX_B.Operator_fz; |
| 16250 | |
| 16251 | /* Logic: '<S1083>/AND1' */ |
| 16252 | L4_MABX_B.AND1 = (L4_MABX_B.OR1_e && EnableSw && L4_MABX_B.NOT1 && |
| 16253 | L4_MABX_B.NOT_o); |
| 16254 | |
| 16255 | /* S-Function (rti_commonblock): '<S1076>/S-Function1' */ |
| 16256 | /* This comment workarounds a code generation problem */ |
| 16257 | |
| 16258 | /* write output state value to digital output channel 1 on port 1 */ |
| 16259 | dio_tp4_digout_write(DIO_TP4_1_MODULE_ADDR, 1, DIO_TP4_MASK_CH1, (UInt16) |
| 16260 | (L4_MABX_B.AND1 << 0)); |
| 16261 | |
| 16262 | /* Logic: '<S1083>/AND' */ |
| 16263 | L4_MABX_B.AND_m = (L4_MABX_B.AutonomousEnabled_d && |
| 16264 | (L4_MABX_B.TmpRTBAtFlashOutport1 != 0.0)); |
| 16265 | |
| 16266 | /* Logic: '<S1083>/OR' */ |
| 16267 | L4_MABX_B.OR = (L4_MABX_B.AND_m || AutonomousOutputEnabled); |
| 16268 | |
| 16269 | /* Logic: '<S1083>/AND2' */ |
| 16270 | L4_MABX_B.AND2_d = (L4_MABX_B.NOT_o && L4_MABX_B.OR); |
| 16271 | |
| 16272 | /* S-Function (rti_commonblock): '<S1077>/S-Function1' */ |
| 16273 | /* This comment workarounds a code generation problem */ |
| 16274 | |
| 16275 | /* write output state value to digital output channel 2 on port 1 */ |
| 16276 | dio_tp4_digout_write(DIO_TP4_1_MODULE_ADDR, 1, DIO_TP4_MASK_CH2, (UInt16) |
| 16277 | (L4_MABX_B.AND2_d << 1)); |
| 16278 | |
| 16279 | /* S-Function (rti_commonblock): '<S1078>/S-Function1' */ |
| 16280 | /* This comment workarounds a code generation problem */ |
| 16281 | |
| 16282 | /* write output state value to digital output channel 6 on port 2 */ |
| 16283 | dio_tp4_digout_write(DIO_TP4_1_MODULE_ADDR, 2, DIO_TP4_MASK_CH6, (UInt16) |
| 16284 | (L4_MABX_B.Operator_fz << 5)); |
| 16285 | |
| 16286 | /* Logic: '<S1081>/Logical Operator' */ |
| 16287 | L4_MABX_B.LogicalOperator_n = !AutonomousOutputEnabled; |
| 16288 | |
| 16289 | /* Outputs for Atomic SubSystem: '<S1081>/If_Then_Else4' */ |
| 16290 | |
| 16291 | /* Constant: '<S1081>/APTC_PEDAL_A_PWM_FREQ_HZ_APV' */ |
| 16292 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_n, |
| 16293 | L4_MABX_B.Pedal_1_pwm_freq_raw_value, |
| 16294 | L4_MABX_P.APTC_PEDAL_A_PWM_FREQ_HZ_APV_Va, |
| 16295 | &L4_MABX_B.If_Then_Else4); |
| 16296 | |
| 16297 | /* End of Outputs for SubSystem: '<S1081>/If_Then_Else4' */ |
| 16298 | |
| 16299 | /* MinMax: '<S856>/MinMax' incorporates: |
| 16300 | * Constant: '<S856>/Constant2' |
| 16301 | */ |
| 16302 | DeltaTime = L4_MABX_B.If_Then_Else4.Switch; |
| 16303 | PositionFinalLimited = L4_MABX_P.Constant2_Value_mi; |
| 16304 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 16305 | PositionFinalLimited = DeltaTime; |
| 16306 | } |
| 16307 | |
| 16308 | L4_MABX_B.MinMax_n = PositionFinalLimited; |
| 16309 | |
| 16310 | /* End of MinMax: '<S856>/MinMax' */ |
| 16311 | |
| 16312 | /* DataTypeConversion: '<S856>/Data Type Conversion1' */ |
| 16313 | L4_MABX_B.DataTypeConversion1 = L4_MABX_B.MinMax_n; |
| 16314 | |
| 16315 | /* Product: '<S856>/Divide' incorporates: |
| 16316 | * Constant: '<S856>/Constant3' |
| 16317 | */ |
| 16318 | L4_MABX_B.Divide_l = L4_MABX_P.Constant3_Value_c / |
| 16319 | L4_MABX_B.DataTypeConversion1; |
| 16320 | |
| 16321 | /* DataTypeConversion: '<S856>/Data Type Conversion5' */ |
| 16322 | L4_MABX_B.PWMOut_P2C1_Period = L4_MABX_B.Divide_l; |
| 16323 | |
| 16324 | /* Lookup_n-D: '<S1081>/1-D Lookup Table2' */ |
| 16325 | L4_MABX_B.PedalPWMA_DC_out = look1_binlcapw(L4_MABX_B.If_Then_Else_f.Switch, |
| 16326 | L4_MABX_P.uDLookupTable2_bp01Data, L4_MABX_P.uDLookupTable2_tableData, 1U); |
| 16327 | |
| 16328 | /* Outputs for Atomic SubSystem: '<S1081>/If_Then_Else1' */ |
| 16329 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_n, |
| 16330 | L4_MABX_B.Pedal_1_pwm_dc_raw_value, |
| 16331 | L4_MABX_B.PedalPWMA_DC_out, &L4_MABX_B.If_Then_Else1_l); |
| 16332 | |
| 16333 | /* End of Outputs for SubSystem: '<S1081>/If_Then_Else1' */ |
| 16334 | |
| 16335 | /* Gain: '<S856>/Gain1' */ |
| 16336 | L4_MABX_B.Gain1_a = L4_MABX_P.Gain1_Gain_oe * L4_MABX_B.If_Then_Else1_l.Switch; |
| 16337 | |
| 16338 | /* DataTypeConversion: '<S856>/Data Type Conversion6' */ |
| 16339 | L4_MABX_B.PWMOut_P2C1_DC = L4_MABX_B.Gain1_a; |
| 16340 | |
| 16341 | /* S-Function (rti_commonblock): '<S1079>/S-Function1' */ |
| 16342 | /* This comment workarounds a code generation problem */ |
| 16343 | |
| 16344 | /* write PWM Period and DutyCycle for output channel 1 on port 2 */ |
| 16345 | dio_tp4_pwm_update(DIO_TP4_1_MODULE_ADDR , 2, 1, (real_T) |
| 16346 | L4_MABX_B.PWMOut_P2C1_Period, (real_T) |
| 16347 | L4_MABX_B.PWMOut_P2C1_DC); |
| 16348 | |
| 16349 | /* Outputs for Atomic SubSystem: '<S1081>/If_Then_Else5' */ |
| 16350 | |
| 16351 | /* Constant: '<S1081>/APTC_PEDAL_B_PWM_FREQ_HZ_APV' */ |
| 16352 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_n, |
| 16353 | L4_MABX_B.Pedal_2_pwm_freq_raw_value, |
| 16354 | L4_MABX_P.APTC_PEDAL_B_PWM_FREQ_HZ_APV_Va, |
| 16355 | &L4_MABX_B.If_Then_Else5); |
| 16356 | |
| 16357 | /* End of Outputs for SubSystem: '<S1081>/If_Then_Else5' */ |
| 16358 | |
| 16359 | /* MinMax: '<S856>/MinMax1' incorporates: |
| 16360 | * Constant: '<S856>/Constant4' |
| 16361 | */ |
| 16362 | DeltaTime = L4_MABX_B.If_Then_Else5.Switch; |
| 16363 | PositionFinalLimited = L4_MABX_P.Constant4_Value_p; |
| 16364 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 16365 | PositionFinalLimited = DeltaTime; |
| 16366 | } |
| 16367 | |
| 16368 | L4_MABX_B.MinMax1_j = PositionFinalLimited; |
| 16369 | |
| 16370 | /* End of MinMax: '<S856>/MinMax1' */ |
| 16371 | |
| 16372 | /* DataTypeConversion: '<S856>/Data Type Conversion2' */ |
| 16373 | L4_MABX_B.DataTypeConversion2_f = L4_MABX_B.MinMax1_j; |
| 16374 | |
| 16375 | /* Product: '<S856>/Divide1' incorporates: |
| 16376 | * Constant: '<S856>/Constant1' |
| 16377 | */ |
| 16378 | L4_MABX_B.Divide1 = L4_MABX_P.Constant1_Value_lv / |
| 16379 | L4_MABX_B.DataTypeConversion2_f; |
| 16380 | |
| 16381 | /* DataTypeConversion: '<S856>/Data Type Conversion9' */ |
| 16382 | L4_MABX_B.PWMOut_P2C2_Period = L4_MABX_B.Divide1; |
| 16383 | |
| 16384 | /* Lookup_n-D: '<S1081>/1-D Lookup Table3' */ |
| 16385 | L4_MABX_B.PedalPWMB_DC_out = look1_binlcapw(L4_MABX_B.If_Then_Else_f.Switch, |
| 16386 | L4_MABX_P.uDLookupTable3_bp01Data, L4_MABX_P.uDLookupTable3_tableData, 1U); |
| 16387 | |
| 16388 | /* Outputs for Atomic SubSystem: '<S1081>/If_Then_Else2' */ |
| 16389 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_n, |
| 16390 | L4_MABX_B.Pedal_2_pwm_dc_raw_value, |
| 16391 | L4_MABX_B.PedalPWMB_DC_out, &L4_MABX_B.If_Then_Else2_m); |
| 16392 | |
| 16393 | /* End of Outputs for SubSystem: '<S1081>/If_Then_Else2' */ |
| 16394 | |
| 16395 | /* Gain: '<S856>/Gain' */ |
| 16396 | L4_MABX_B.Gain_h = L4_MABX_P.Gain_Gain_d * L4_MABX_B.If_Then_Else2_m.Switch; |
| 16397 | |
| 16398 | /* DataTypeConversion: '<S856>/Data Type Conversion10' */ |
| 16399 | L4_MABX_B.PWMOut_P2C2_DC = L4_MABX_B.Gain_h; |
| 16400 | |
| 16401 | /* S-Function (rti_commonblock): '<S1080>/S-Function1' */ |
| 16402 | /* This comment workarounds a code generation problem */ |
| 16403 | |
| 16404 | /* write PWM Period and DutyCycle for output channel 2 on port 2 */ |
| 16405 | dio_tp4_pwm_update(DIO_TP4_1_MODULE_ADDR , 2, 2, (real_T) |
| 16406 | L4_MABX_B.PWMOut_P2C2_Period, (real_T) |
| 16407 | L4_MABX_B.PWMOut_P2C2_DC); |
| 16408 | |
| 16409 | /* S-Function (rti_commonblock): '<S745>/S-Function1' */ |
| 16410 | /* This comment workarounds a code generation problem */ |
| 16411 | |
| 16412 | /* Gain: '<S422>/ShifterControlDC' */ |
| 16413 | L4_MABX_B.ShiftControlDC = L4_MABX_P.ShifterControlDC_Gain * |
| 16414 | L4_MABX_B.SFunction1_o2_i; |
| 16415 | |
| 16416 | /* RelationalOperator: '<S1082>/Relational Operator' incorporates: |
| 16417 | * Constant: '<S1082>/Constant' |
| 16418 | */ |
| 16419 | L4_MABX_B.RelationalOperator_d = (L4_MABX_B.ShiftControlDC >= |
| 16420 | L4_MABX_P.Constant_Value_lg); |
| 16421 | |
| 16422 | /* RelationalOperator: '<S1082>/Relational Operator1' incorporates: |
| 16423 | * Constant: '<S1082>/Constant1' |
| 16424 | */ |
| 16425 | L4_MABX_B.RelationalOperator1_o = (L4_MABX_B.ShiftControlDC <= |
| 16426 | L4_MABX_P.Constant1_Value_g5); |
| 16427 | |
| 16428 | /* Logic: '<S1082>/Logical Operator' */ |
| 16429 | L4_MABX_B.LogicalOperator_e = (L4_MABX_B.RelationalOperator_d && |
| 16430 | L4_MABX_B.RelationalOperator1_o); |
| 16431 | |
| 16432 | /* RelationalOperator: '<S1088>/Compare' incorporates: |
| 16433 | * Constant: '<S1088>/Constant' |
| 16434 | */ |
| 16435 | L4_MABX_B.Compare_pu = (L4_MABX_B.SPN524_TransSelectedGear == |
| 16436 | L4_MABX_P.Constant_Value_af); |
| 16437 | |
| 16438 | /* RelationalOperator: '<S1089>/Compare' incorporates: |
| 16439 | * Constant: '<S1089>/Constant' |
| 16440 | */ |
| 16441 | L4_MABX_B.Compare_j = (L4_MABX_B.SPN523_TransCurrentGear == |
| 16442 | L4_MABX_P.Constant_Value_j1); |
| 16443 | |
| 16444 | /* Logic: '<S1082>/Logical Operator1' */ |
| 16445 | L4_MABX_B.LogicalOperator1_p = (L4_MABX_B.Compare_pu && L4_MABX_B.Compare_j); |
| 16446 | |
| 16447 | /* Outputs for Atomic SubSystem: '<S1082>/If_Then_Else' */ |
| 16448 | |
| 16449 | /* Constant: '<S1082>/F_ALLOW_ETC2_FOR_NEUTRAL_OUTPUT_APV' incorporates: |
| 16450 | * Constant: '<S1082>/Constant2' |
| 16451 | */ |
| 16452 | L4_MABX_If_Then_Else3(L4_MABX_P.F_ALLOW_ETC2_FOR_NEUTRAL_OUTPUT, |
| 16453 | L4_MABX_B.LogicalOperator1_p, |
| 16454 | L4_MABX_P.Constant2_Value_f, &L4_MABX_B.If_Then_Else_e); |
| 16455 | |
| 16456 | /* End of Outputs for SubSystem: '<S1082>/If_Then_Else' */ |
| 16457 | |
| 16458 | /* Logic: '<S1082>/Logical Operator2' */ |
| 16459 | L4_MABX_B.Neutral = (L4_MABX_B.LogicalOperator_e || |
| 16460 | L4_MABX_B.If_Then_Else_e.Switch); |
| 16461 | |
| 16462 | /* Logic: '<S856>/Logical Operator' */ |
| 16463 | L4_MABX_B.LogicalOperator_bx = !L4_MABX_B.Neutral; |
| 16464 | |
| 16465 | /* Outputs for Enabled SubSystem: '<S579>/GNSSDOPs_011' incorporates: |
| 16466 | * EnablePort: '<S580>/Enable' |
| 16467 | */ |
| 16468 | /* Constant: '<S447>/Constant' */ |
| 16469 | if (L4_MABX_P.Constant_Value_by > 0.0) { |
| 16470 | /* S-Function (rti_commonblock): '<S580>/S-Function1' */ |
| 16471 | /* This comment workarounds a code generation problem */ |
| 16472 | |
| 16473 | /* dSPACE RTICAN RX Message Block: "GNSSDOPs_01" Id:435815168 */ |
| 16474 | { |
| 16475 | UInt32 *CAN_Msg; |
| 16476 | static dsfloat time_old = 0.0; |
| 16477 | |
| 16478 | /* Read status and timestamp info (previous message) */ |
| 16479 | if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0300].timestamp != |
| 16480 | time_old) { |
| 16481 | /* ... save timestamp info for the calculation of the RX status |
| 16482 | during the consecutive sample hit*/ |
| 16483 | time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0300]. |
| 16484 | timestamp; |
| 16485 | |
| 16486 | /* ... set the processed flag to one */ |
| 16487 | L4_MABX_B.SFunction1_o7_l3 = 1.0; |
| 16488 | L4_MABX_B.SFunction1_o8_es = (real_T) |
| 16489 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0300].timestamp; |
| 16490 | L4_MABX_B.SFunction1_o9_gd = (real_T) |
| 16491 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0300].deltatime; |
| 16492 | CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0300].data; |
| 16493 | |
| 16494 | /* Decode CAN message */ |
| 16495 | { |
| 16496 | { |
| 16497 | rtican_Signal_t CAN_Sgn; |
| 16498 | |
| 16499 | /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */ |
| 16500 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 16501 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 16502 | L4_MABX_B.SFunction1_o1_hs = ((real_T) CAN_Sgn.UnsignedSgn); |
| 16503 | |
| 16504 | /* ...... "SetMode" (8|3, standard signal, unsigned int, little endian) */ |
| 16505 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 16506 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 16507 | L4_MABX_B.SFunction1_o2_d0 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 16508 | |
| 16509 | /* ...... "OpMode" (11|3, standard signal, unsigned int, little endian) */ |
| 16510 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 16511 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 3; |
| 16512 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 16513 | L4_MABX_B.SFunction1_o3_o4 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 16514 | |
| 16515 | /* ...... "HDOP_" (16|16, standard signal, signed int, little endian) */ |
| 16516 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 16517 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 16518 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 16519 | if (CAN_Sgn.SignedSgn >> 15) { |
| 16520 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 16521 | } |
| 16522 | |
| 16523 | L4_MABX_B.SFunction1_o4_j0 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 16524 | |
| 16525 | /* ...... "VDOP" (32|16, standard signal, signed int, little endian) */ |
| 16526 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 16527 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 16528 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 16529 | if (CAN_Sgn.SignedSgn >> 15) { |
| 16530 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 16531 | } |
| 16532 | |
| 16533 | L4_MABX_B.SFunction1_o5_nf = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 16534 | |
| 16535 | /* ...... "TDOP" (48|16, standard signal, signed int, little endian) */ |
| 16536 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 16537 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[7]; |
| 16538 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 16539 | if (CAN_Sgn.SignedSgn >> 15) { |
| 16540 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 16541 | } |
| 16542 | |
| 16543 | L4_MABX_B.SFunction1_o6_g4y = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 16544 | } |
| 16545 | } |
| 16546 | } else { |
| 16547 | /* set RX status to 0 because no new message has arrived */ |
| 16548 | L4_MABX_B.SFunction1_o7_l3 = 0.0; |
| 16549 | } |
| 16550 | } |
| 16551 | } |
| 16552 | |
| 16553 | /* End of Outputs for SubSystem: '<S579>/GNSSDOPs_011' */ |
| 16554 | |
| 16555 | /* DataTypeConversion: '<S579>/Data Type Conversion8' */ |
| 16556 | L4_MABX_B.RX_status_h = (L4_MABX_B.SFunction1_o7_l3 != 0.0); |
| 16557 | |
| 16558 | /* Outputs for Enabled SubSystem: '<S579>/GNSSDOPs_1' incorporates: |
| 16559 | * EnablePort: '<S581>/Enable' |
| 16560 | */ |
| 16561 | /* Constant: '<S447>/Constant' */ |
| 16562 | if (L4_MABX_P.Constant_Value_by > 0.0) { |
| 16563 | /* S-Function (rti_commonblock): '<S581>/S-Function1' */ |
| 16564 | /* This comment workarounds a code generation problem */ |
| 16565 | |
| 16566 | /* dSPACE RTICAN RX Message Block: "GNSSDOPs_01" Id:435815169 */ |
| 16567 | { |
| 16568 | UInt32 *CAN_Msg; |
| 16569 | static dsfloat time_old = 0.0; |
| 16570 | |
| 16571 | /* Read status and timestamp info (previous message) */ |
| 16572 | if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0301].timestamp != |
| 16573 | time_old) { |
| 16574 | /* ... save timestamp info for the calculation of the RX status |
| 16575 | during the consecutive sample hit*/ |
| 16576 | time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0301]. |
| 16577 | timestamp; |
| 16578 | |
| 16579 | /* ... set the processed flag to one */ |
| 16580 | L4_MABX_B.SFunction1_o7_ev = 1.0; |
| 16581 | L4_MABX_B.SFunction1_o8_lx = (real_T) |
| 16582 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0301].timestamp; |
| 16583 | L4_MABX_B.SFunction1_o9_d = (real_T) |
| 16584 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0301].deltatime; |
| 16585 | CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0301].data; |
| 16586 | |
| 16587 | /* Decode CAN message */ |
| 16588 | { |
| 16589 | { |
| 16590 | rtican_Signal_t CAN_Sgn; |
| 16591 | |
| 16592 | /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */ |
| 16593 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 16594 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 16595 | L4_MABX_B.SFunction1_o1_lx = ((real_T) CAN_Sgn.UnsignedSgn); |
| 16596 | |
| 16597 | /* ...... "SetMode" (8|3, standard signal, unsigned int, little endian) */ |
| 16598 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 16599 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 16600 | L4_MABX_B.SFunction1_o2_ad5 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 16601 | |
| 16602 | /* ...... "OpMode" (11|3, standard signal, unsigned int, little endian) */ |
| 16603 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 16604 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 3; |
| 16605 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 16606 | L4_MABX_B.SFunction1_o3_g5 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 16607 | |
| 16608 | /* ...... "HDOP_" (16|16, standard signal, signed int, little endian) */ |
| 16609 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 16610 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 16611 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 16612 | if (CAN_Sgn.SignedSgn >> 15) { |
| 16613 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 16614 | } |
| 16615 | |
| 16616 | L4_MABX_B.SFunction1_o4_iv = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 16617 | |
| 16618 | /* ...... "VDOP" (32|16, standard signal, signed int, little endian) */ |
| 16619 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 16620 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 16621 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 16622 | if (CAN_Sgn.SignedSgn >> 15) { |
| 16623 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 16624 | } |
| 16625 | |
| 16626 | L4_MABX_B.SFunction1_o5_lw = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 16627 | |
| 16628 | /* ...... "TDOP" (48|16, standard signal, signed int, little endian) */ |
| 16629 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 16630 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[7]; |
| 16631 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 16632 | if (CAN_Sgn.SignedSgn >> 15) { |
| 16633 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 16634 | } |
| 16635 | |
| 16636 | L4_MABX_B.SFunction1_o6_nk = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 16637 | } |
| 16638 | } |
| 16639 | } else { |
| 16640 | /* set RX status to 0 because no new message has arrived */ |
| 16641 | L4_MABX_B.SFunction1_o7_ev = 0.0; |
| 16642 | } |
| 16643 | } |
| 16644 | } |
| 16645 | |
| 16646 | /* End of Outputs for SubSystem: '<S579>/GNSSDOPs_1' */ |
| 16647 | |
| 16648 | /* Switch: '<S579>/Switch' */ |
| 16649 | if (L4_MABX_B.RX_status_h) { |
| 16650 | L4_MABX_B.HDOP_ = L4_MABX_B.SFunction1_o4_j0; |
| 16651 | } else { |
| 16652 | L4_MABX_B.HDOP_ = L4_MABX_B.SFunction1_o4_iv; |
| 16653 | } |
| 16654 | |
| 16655 | /* Outputs for Atomic SubSystem: '<S65>/Task_20ms' */ |
| 16656 | /* RateTransition: '<S401>/TmpRTBAtCheckHDOPInport1' */ |
| 16657 | if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) { |
| 16658 | L4_MABX_B.HDOP__f = L4_MABX_B.HDOP_; |
| 16659 | L4_MABX_B.FrontAxleSpeed_d = L4_MABX_B.SFunction1_o1_gd; |
| 16660 | L4_MABX_B.FrontAxleSpeed_dv = L4_MABX_B.SFunction1_o1_gd; |
| 16661 | L4_MABX_B.FrontAxleSpeed_dvq = L4_MABX_B.SFunction1_o1_gd; |
| 16662 | L4_MABX_B.TmpRTBAtVehHeadingInport1 = YawRate; |
| 16663 | } |
| 16664 | |
| 16665 | /* End of RateTransition: '<S401>/TmpRTBAtCheckHDOPInport1' */ |
| 16666 | /* End of Outputs for SubSystem: '<S65>/Task_20ms' */ |
| 16667 | |
| 16668 | /* Switch: '<S403>/Switch2' incorporates: |
| 16669 | * Constant: '<S403>/No Data' |
| 16670 | * Switch: '<S403>/Switch6' |
| 16671 | * Switch: '<S403>/Switch7' |
| 16672 | * Switch: '<S403>/Switch8' |
| 16673 | */ |
| 16674 | if (RTMapsOk) { |
| 16675 | /* Gain: '<S403>/m//s_to_km//h' */ |
| 16676 | L4_MABX_B.ms_to_kmh = L4_MABX_P.ms_to_kmh_Gain * |
| 16677 | L4_MABX_B.Decoder_o1.CurrentVelocity; |
| 16678 | CurrentVelocity_kph = L4_MABX_B.ms_to_kmh; |
| 16679 | |
| 16680 | /* Gain: '<S403>/for_logging4' */ |
| 16681 | L4_MABX_B.for_logging4 = L4_MABX_P.for_logging4_Gain * |
| 16682 | L4_MABX_B.Decoder_o1.GPS_X; |
| 16683 | GPS_X = L4_MABX_B.for_logging4; |
| 16684 | |
| 16685 | /* Gain: '<S403>/for_logging5' */ |
| 16686 | L4_MABX_B.for_logging5 = L4_MABX_P.for_logging5_Gain * |
| 16687 | L4_MABX_B.Decoder_o1.GPS_Y; |
| 16688 | GPS_Y = L4_MABX_B.for_logging5; |
| 16689 | |
| 16690 | /* Gain: '<S403>/for_logging6' */ |
| 16691 | L4_MABX_B.for_logging6 = L4_MABX_P.for_logging6_Gain * |
| 16692 | L4_MABX_B.Decoder_o1.GPS_Time; |
| 16693 | GPS_Time = L4_MABX_B.for_logging6; |
| 16694 | } else { |
| 16695 | CurrentVelocity_kph = L4_MABX_P.NoData_Value; |
| 16696 | GPS_X = L4_MABX_P.NoData_Value; |
| 16697 | GPS_Y = L4_MABX_P.NoData_Value; |
| 16698 | GPS_Time = L4_MABX_P.NoData_Value; |
| 16699 | } |
| 16700 | |
| 16701 | /* End of Switch: '<S403>/Switch2' */ |
| 16702 | |
| 16703 | /* S-Function (rti_commonblock): '<S414>/S-Function1' */ |
| 16704 | |
| 16705 | /* This comment workarounds a code generation problem */ |
| 16706 | |
| 16707 | /* End of Outputs for S-Function (rti_commonblock): '<S414>/S-Function1' */ |
| 16708 | |
| 16709 | /* S-Function (rti_commonblock): '<S420>/S-Function1' */ |
| 16710 | |
| 16711 | /* This comment workarounds a code generation problem */ |
| 16712 | |
| 16713 | /* End of Outputs for S-Function (rti_commonblock): '<S420>/S-Function1' */ |
| 16714 | |
| 16715 | /* S-Function (rti_commonblock): '<S405>/TRC Exclusion' */ |
| 16716 | /* This comment workarounds a code generation problem */ |
| 16717 | |
| 16718 | /* S-Function (rti_commonblock): '<S406>/TRC Exclusion' */ |
| 16719 | /* This comment workarounds a code generation problem */ |
| 16720 | |
| 16721 | /* UnitDelay: '<S3>/Unit_Delay' */ |
| 16722 | L4_MABX_B.DesSteeringAngle = L4_MABX_DW.Unit_Delay_1_DSTATE; |
| 16723 | L4_MABX_B.Stanley_axleAngle2 = L4_MABX_DW.Unit_Delay_10_DSTATE; |
| 16724 | L4_MABX_B.DriversDemandEngPercentTorque = L4_MABX_DW.Unit_Delay_100_DSTATE; |
| 16725 | L4_MABX_B.SPN514_NominalFrictionPercent_g = L4_MABX_DW.Unit_Delay_101_DSTATE; |
| 16726 | L4_MABX_B.SPN2978_EstEngParasiticLosses_m = L4_MABX_DW.Unit_Delay_102_DSTATE; |
| 16727 | L4_MABX_B.SPN1760_GrossCombinationVehic_h = L4_MABX_DW.Unit_Delay_103_DSTATE; |
| 16728 | L4_MABX_B.ACCDistanceAlertSignal_o = L4_MABX_DW.Unit_Delay_104_DSTATE; |
| 16729 | L4_MABX_B.ForwardCollisionWarning_c = L4_MABX_DW.Unit_Delay_105_DSTATE; |
| 16730 | L4_MABX_B.SPN544_EngineReferenceTorque_g = L4_MABX_DW.Unit_Delay_106_DSTATE; |
| 16731 | L4_MABX_B.ROPEngCtrlActive = L4_MABX_DW.Unit_Delay_107_DSTATE; |
| 16732 | L4_MABX_B.ROPBrakeCtrlActive = L4_MABX_DW.Unit_Delay_108_DSTATE; |
| 16733 | L4_MABX_B.YCEngCtrlActive = L4_MABX_DW.Unit_Delay_109_DSTATE; |
| 16734 | L4_MABX_B.DesSteeringAngleTerm = L4_MABX_DW.Unit_Delay_11_DSTATE; |
| 16735 | L4_MABX_B.YCBrakeCtrlActive = L4_MABX_DW.Unit_Delay_110_DSTATE; |
| 16736 | L4_MABX_B.SPN1807_SteeringWheelAngle = L4_MABX_DW.Unit_Delay_111_DSTATE; |
| 16737 | L4_MABX_B.SPN1808_YawRate = L4_MABX_DW.Unit_Delay_112_DSTATE; |
| 16738 | L4_MABX_B.SPN1810_LongitudinalAcceleratio = L4_MABX_DW.Unit_Delay_113_DSTATE; |
| 16739 | L4_MABX_B.SteerWheelTurnCounter = L4_MABX_DW.Unit_Delay_114_DSTATE; |
| 16740 | L4_MABX_B.SteerWheelAngleSensorType = L4_MABX_DW.Unit_Delay_115_DSTATE; |
| 16741 | L4_MABX_B.LateralAcceleration = L4_MABX_DW.Unit_Delay_116_DSTATE; |
| 16742 | L4_MABX_B.BarometricPress = L4_MABX_DW.Unit_Delay_117_DSTATE; |
| 16743 | L4_MABX_B.AmbientAirTemp = L4_MABX_DW.Unit_Delay_118_DSTATE; |
| 16744 | L4_MABX_B.F_Truck1571_VIN_Match = L4_MABX_DW.Unit_Delay_119_DSTATE; |
| 16745 | L4_MABX_B.DesSteeringDistTerm = L4_MABX_DW.Unit_Delay_12_DSTATE; |
| 16746 | L4_MABX_B.F_Truck166_VIN_Match = L4_MABX_DW.Unit_Delay_120_DSTATE; |
| 16747 | L4_MABX_B.PitchAngleExRange_m = L4_MABX_DW.Unit_Delay_121_DSTATE; |
| 16748 | L4_MABX_B.PX2_LanePosEstPosition = L4_MABX_DW.Unit_Delay_122_DSTATE; |
| 16749 | L4_MABX_B.PX2_LanePosEstAngle = L4_MABX_DW.Unit_Delay_123_DSTATE; |
| 16750 | L4_MABX_B.PX2_LanePosEstNumPoints = L4_MABX_DW.Unit_Delay_124_DSTATE; |
| 16751 | L4_MABX_B.Latitude__c = L4_MABX_DW.Unit_Delay_125_DSTATE; |
| 16752 | L4_MABX_B.Longitude__m = L4_MABX_DW.Unit_Delay_126_DSTATE; |
| 16753 | L4_MABX_B.HDOP__o = L4_MABX_DW.Unit_Delay_127_DSTATE; |
| 16754 | L4_MABX_B.XPRControlMode_d = L4_MABX_DW.Unit_Delay_128_DSTATE; |
| 16755 | L4_MABX_B.XPRErrorState_d = L4_MABX_DW.Unit_Delay_129_DSTATE; |
| 16756 | L4_MABX_B.numLanePoints = L4_MABX_DW.Unit_Delay_13_DSTATE; |
| 16757 | L4_MABX_B.PressureP1_a = L4_MABX_DW.Unit_Delay_130_DSTATE; |
| 16758 | L4_MABX_B.PressureP4_h = L4_MABX_DW.Unit_Delay_131_DSTATE; |
| 16759 | L4_MABX_B.PressureP21_b = L4_MABX_DW.Unit_Delay_132_DSTATE; |
| 16760 | L4_MABX_B.PressureP22_e = L4_MABX_DW.Unit_Delay_133_DSTATE; |
| 16761 | L4_MABX_B.PressureP42_n = L4_MABX_DW.Unit_Delay_134_DSTATE; |
| 16762 | L4_MABX_B.ReAX_ActualHandwheelPos_p = L4_MABX_DW.Unit_Delay_135_DSTATE; |
| 16763 | L4_MABX_B.ReAX_EchoedSteerWheelPos_p = L4_MABX_DW.Unit_Delay_136_DSTATE; |
| 16764 | L4_MABX_B.SystemsOk_a = L4_MABX_DW.Unit_Delay_137_DSTATE; |
| 16765 | L4_MABX_B.SupervisorMode_l = L4_MABX_DW.Unit_Delay_138_DSTATE; |
| 16766 | L4_MABX_B.CurrentAzimuth_rad_k = L4_MABX_DW.Unit_Delay_139_DSTATE; |
| 16767 | L4_MABX_B.rawPositionError = L4_MABX_DW.Unit_Delay_14_DSTATE; |
| 16768 | L4_MABX_B.TargetAzimuth_rad_i = L4_MABX_DW.Unit_Delay_140_DSTATE; |
| 16769 | L4_MABX_B.CurrentVelocity_kph_k = L4_MABX_DW.Unit_Delay_141_DSTATE; |
| 16770 | L4_MABX_B.TargetVelocity_kph_m = L4_MABX_DW.Unit_Delay_142_DSTATE; |
| 16771 | L4_MABX_B.Curvature_a = L4_MABX_DW.Unit_Delay_143_DSTATE; |
| 16772 | L4_MABX_B.CrosstrackError_n = L4_MABX_DW.Unit_Delay_144_DSTATE; |
| 16773 | L4_MABX_B.slewedPosError = L4_MABX_DW.Unit_Delay_15_DSTATE; |
| 16774 | L4_MABX_B.previewSteeringAngle = L4_MABX_DW.Unit_Delay_16_DSTATE; |
| 16775 | L4_MABX_B.APTC_Pedal_torque_dem_value = L4_MABX_DW.Unit_Delay_17_DSTATE; |
| 16776 | L4_MABX_B.APTC_arb_pedal_low_idl_sw = L4_MABX_DW.Unit_Delay_18_DSTATE; |
| 16777 | L4_MABX_B.APTC_arb_pedal_position = L4_MABX_DW.Unit_Delay_19_DSTATE; |
| 16778 | L4_MABX_B.DesSteeringPID_Dterm = L4_MABX_DW.Unit_Delay_2_DSTATE; |
| 16779 | L4_MABX_B.signal1 = L4_MABX_DW.Unit_Delay_20_DSTATE; |
| 16780 | L4_MABX_B.PID_output = L4_MABX_DW.Unit_Delay_21_DSTATE; |
| 16781 | L4_MABX_B.PID_output_unlim = L4_MABX_DW.Unit_Delay_22_DSTATE; |
| 16782 | L4_MABX_B.PID_control_error = L4_MABX_DW.Unit_Delay_23_DSTATE; |
| 16783 | L4_MABX_B.PID_p_term = L4_MABX_DW.Unit_Delay_24_DSTATE; |
| 16784 | L4_MABX_B.PID_i_term = L4_MABX_DW.Unit_Delay_25_DSTATE; |
| 16785 | L4_MABX_B.PID_d_term = L4_MABX_DW.Unit_Delay_26_DSTATE; |
| 16786 | L4_MABX_B.PID_hold_i_term_f = L4_MABX_DW.Unit_Delay_27_DSTATE; |
| 16787 | L4_MABX_B.ThrottlePID_Y = L4_MABX_DW.Unit_Delay_28_DSTATE; |
| 16788 | L4_MABX_B.EngineSpeedTarget_Y = L4_MABX_DW.Unit_Delay_29_DSTATE; |
| 16789 | L4_MABX_B.DesSteeringPID_Iterm = L4_MABX_DW.Unit_Delay_3_DSTATE; |
| 16790 | L4_MABX_B.F_Ignition_relay_command = L4_MABX_DW.Unit_Delay_30_DSTATE; |
| 16791 | L4_MABX_B.F_Inverter_relay_command = L4_MABX_DW.Unit_Delay_31_DSTATE; |
| 16792 | L4_MABX_B.F_MABX_relay_command = L4_MABX_DW.Unit_Delay_32_DSTATE; |
| 16793 | L4_MABX_B.F_Sensor_relay_command = L4_MABX_DW.Unit_Delay_33_DSTATE; |
| 16794 | L4_MABX_B.BrkPedArbBrakeSwitch = L4_MABX_DW.Unit_Delay_34_DSTATE; |
| 16795 | L4_MABX_B.Accel_rate_ms2 = L4_MABX_DW.Unit_Delay_35_DSTATE; |
| 16796 | L4_MABX_B.BrakingControlActive = L4_MABX_DW.Unit_Delay_36_DSTATE; |
| 16797 | L4_MABX_B.F_Hold_brakes_at_zero = L4_MABX_DW.Unit_Delay_37_DSTATE; |
| 16798 | L4_MABX_B.BrakingPID_Y = L4_MABX_DW.Unit_Delay_38_DSTATE; |
| 16799 | L4_MABX_B.BrakingPID_Y_Direct_Pressure = L4_MABX_DW.Unit_Delay_39_DSTATE; |
| 16800 | L4_MABX_B.DesSteeringPID_Pterm = L4_MABX_DW.Unit_Delay_4_DSTATE; |
| 16801 | L4_MABX_B.VSPD_TARGET_KPH_APV_h = L4_MABX_DW.Unit_Delay_40_DSTATE; |
| 16802 | L4_MABX_B.Vehicle_speed_target = L4_MABX_DW.Unit_Delay_41_DSTATE; |
| 16803 | L4_MABX_B.VSPD_HYST_KPH_APV = L4_MABX_DW.Unit_Delay_42_DSTATE; |
| 16804 | L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_APV = L4_MABX_DW.Unit_Delay_43_DSTATE; |
| 16805 | L4_MABX_B.ACCEL_LIM_MS2_APV = L4_MABX_DW.Unit_Delay_44_DSTATE; |
| 16806 | L4_MABX_B.AutonomousOutputEnabled_n = L4_MABX_DW.Unit_Delay_46_DSTATE; |
| 16807 | L4_MABX_B.DesSteeringPID_Y = L4_MABX_DW.Unit_Delay_5_DSTATE; |
| 16808 | L4_MABX_B.DesSteeringPID_e = L4_MABX_DW.Unit_Delay_6_DSTATE; |
| 16809 | L4_MABX_B.DeSteeringPID_Y2 = L4_MABX_DW.Unit_Delay_7_DSTATE; |
| 16810 | L4_MABX_B.CurvatureEst = L4_MABX_DW.Unit_Delay_8_DSTATE; |
| 16811 | L4_MABX_B.EngagePB_g = L4_MABX_DW.Unit_Delay_82_DSTATE; |
| 16812 | L4_MABX_B.PedalPWMPos = L4_MABX_DW.Unit_Delay_85_DSTATE; |
| 16813 | L4_MABX_B.IgnitionKeySwitch_voltage_c = L4_MABX_DW.Unit_Delay_86_DSTATE; |
| 16814 | L4_MABX_B.BrakeSwitch_a = L4_MABX_DW.Unit_Delay_87_DSTATE; |
| 16815 | L4_MABX_B.Park_brake_switch = L4_MABX_DW.Unit_Delay_88_DSTATE; |
| 16816 | L4_MABX_B.CruiseCtrlEnableSwitch = L4_MABX_DW.Unit_Delay_89_DSTATE; |
| 16817 | L4_MABX_B.Stanley_axleAngle = L4_MABX_DW.Unit_Delay_9_DSTATE; |
| 16818 | L4_MABX_B.FrontAxleSpeed = L4_MABX_DW.Unit_Delay_90_DSTATE; |
| 16819 | L4_MABX_B.FrontAxleLeftWheelSpeed = L4_MABX_DW.Unit_Delay_91_DSTATE; |
| 16820 | L4_MABX_B.FrontAxleRightWheelSpeed = L4_MABX_DW.Unit_Delay_92_DSTATE; |
| 16821 | L4_MABX_B.EBSBrakeSwitch = L4_MABX_DW.Unit_Delay_93_DSTATE; |
| 16822 | L4_MABX_B.SPN524_TransSelectedGear_m = L4_MABX_DW.Unit_Delay_94_DSTATE; |
| 16823 | L4_MABX_B.SPN523_TransCurrentGear_n = L4_MABX_DW.Unit_Delay_95_DSTATE; |
| 16824 | L4_MABX_B.SPN526_TransActualGearRatio_f = L4_MABX_DW.Unit_Delay_96_DSTATE; |
| 16825 | L4_MABX_B.ActualEngPercentTorque = L4_MABX_DW.Unit_Delay_97_DSTATE; |
| 16826 | L4_MABX_B.ActlEngPrcntTrqueHighResolution = L4_MABX_DW.Unit_Delay_98_DSTATE; |
| 16827 | L4_MABX_B.EngSpeed = L4_MABX_DW.Unit_Delay_99_DSTATE; |
| 16828 | |
| 16829 | /* DataTypeConversion: '<S532>/Data Type Conversion' */ |
| 16830 | L4_MABX_B.DataTypeConversion_ke = L4_MABX_B.DataTypeConversion_bq[0]; |
| 16831 | |
| 16832 | /* DataTypeConversion: '<S532>/Data Type Conversion1' */ |
| 16833 | L4_MABX_B.DataTypeConversion1_li = L4_MABX_B.DataTypeConversion_bq[1]; |
| 16834 | |
| 16835 | /* ArithShift: '<S532>/Shift Arithmetic' */ |
| 16836 | L4_MABX_B.ShiftArithmetic_h = (uint16_T)(L4_MABX_B.DataTypeConversion1_li << 8); |
| 16837 | |
| 16838 | /* S-Function (sfix_bitop): '<S559>/Operator' */ |
| 16839 | L4_MABX_B.Operator_b3 = (uint16_T)(L4_MABX_B.DataTypeConversion_ke | |
| 16840 | L4_MABX_B.ShiftArithmetic_h); |
| 16841 | |
| 16842 | /* DataTypeConversion: '<S559>/DataType' */ |
| 16843 | L4_MABX_B.DataType_eq = L4_MABX_B.Operator_b3; |
| 16844 | |
| 16845 | /* DataTypeConversion: '<S532>/Data Type Conversion2' */ |
| 16846 | L4_MABX_B.DataTypeConversion2_b = L4_MABX_B.DataType_eq; |
| 16847 | |
| 16848 | /* Product: '<S532>/Product' incorporates: |
| 16849 | * Constant: '<S532>/Constant' |
| 16850 | */ |
| 16851 | L4_MABX_B.SPN188_EngineSpeedAtIdlePoint1 = L4_MABX_B.DataTypeConversion2_b * |
| 16852 | L4_MABX_P.Constant_Value_g3; |
| 16853 | |
| 16854 | /* DataTypeConversion: '<S424>/Data Type Conversion' */ |
| 16855 | L4_MABX_B.DataTypeConversion_a = L4_MABX_B.SPN188_EngineSpeedAtIdlePoint1; |
| 16856 | |
| 16857 | /* DataTypeConversion: '<S539>/Data Type Conversion' */ |
| 16858 | L4_MABX_B.DataTypeConversion_c = L4_MABX_B.DataTypeConversion_bq[2]; |
| 16859 | |
| 16860 | /* Sum: '<S539>/Add' incorporates: |
| 16861 | * Constant: '<S539>/Constant' |
| 16862 | */ |
| 16863 | L4_MABX_B.SPN539_EnginePercentTorqueAtIdl = L4_MABX_B.DataTypeConversion_c + |
| 16864 | L4_MABX_P.Constant_Value_ou; |
| 16865 | |
| 16866 | /* DataTypeConversion: '<S424>/Data Type Conversion1' */ |
| 16867 | L4_MABX_B.DataTypeConversion1_f = L4_MABX_B.SPN539_EnginePercentTorqueAtIdl; |
| 16868 | |
| 16869 | /* DataTypeConversion: '<S536>/Data Type Conversion' */ |
| 16870 | L4_MABX_B.DataTypeConversion_o = L4_MABX_B.DataTypeConversion_bq[15]; |
| 16871 | |
| 16872 | /* DataTypeConversion: '<S536>/Data Type Conversion1' */ |
| 16873 | L4_MABX_B.DataTypeConversion1_hdz = L4_MABX_B.DataTypeConversion_bq[16]; |
| 16874 | |
| 16875 | /* ArithShift: '<S536>/Shift Arithmetic' */ |
| 16876 | L4_MABX_B.ShiftArithmetic_k = (uint16_T)(L4_MABX_B.DataTypeConversion1_hdz << |
| 16877 | 8); |
| 16878 | |
| 16879 | /* S-Function (sfix_bitop): '<S561>/Operator' */ |
| 16880 | L4_MABX_B.Operator_lb = (uint16_T)(L4_MABX_B.DataTypeConversion_o | |
| 16881 | L4_MABX_B.ShiftArithmetic_k); |
| 16882 | |
| 16883 | /* DataTypeConversion: '<S561>/DataType' */ |
| 16884 | L4_MABX_B.DataType_ni = L4_MABX_B.Operator_lb; |
| 16885 | |
| 16886 | /* DataTypeConversion: '<S536>/Data Type Conversion2' */ |
| 16887 | L4_MABX_B.DataTypeConversion2_ft = L4_MABX_B.DataType_ni; |
| 16888 | |
| 16889 | /* Product: '<S536>/Product' incorporates: |
| 16890 | * Constant: '<S536>/Constant' |
| 16891 | */ |
| 16892 | L4_MABX_B.SPN532_EngineSpeedAtHighIdlePoi = L4_MABX_B.DataTypeConversion2_ft * |
| 16893 | L4_MABX_P.Constant_Value_pj; |
| 16894 | |
| 16895 | /* DataTypeConversion: '<S424>/Data Type Conversion10' */ |
| 16896 | L4_MABX_B.DataTypeConversion10 = L4_MABX_B.SPN532_EngineSpeedAtHighIdlePoi; |
| 16897 | |
| 16898 | /* DataTypeConversion: '<S537>/Data Type Conversion1' */ |
| 16899 | L4_MABX_B.DataTypeConversion1_hs = L4_MABX_B.DataTypeConversion_bq[17]; |
| 16900 | |
| 16901 | /* DataTypeConversion: '<S537>/Data Type Conversion3' */ |
| 16902 | L4_MABX_B.DataTypeConversion3_k = L4_MABX_B.DataTypeConversion_bq[18]; |
| 16903 | |
| 16904 | /* ArithShift: '<S537>/Shift Arithmetic' */ |
| 16905 | L4_MABX_B.ShiftArithmetic_m = (uint16_T)(L4_MABX_B.DataTypeConversion3_k << 8); |
| 16906 | |
| 16907 | /* S-Function (sfix_bitop): '<S562>/Operator' */ |
| 16908 | L4_MABX_B.Operator_c = (uint16_T)(L4_MABX_B.DataTypeConversion1_hs | |
| 16909 | L4_MABX_B.ShiftArithmetic_m); |
| 16910 | |
| 16911 | /* DataTypeConversion: '<S562>/DataType' */ |
| 16912 | L4_MABX_B.DataType_ce = L4_MABX_B.Operator_c; |
| 16913 | |
| 16914 | /* DataTypeConversion: '<S537>/Data Type Conversion2' */ |
| 16915 | L4_MABX_B.DataTypeConversion2_i = L4_MABX_B.DataType_ce; |
| 16916 | |
| 16917 | /* Product: '<S537>/Product' incorporates: |
| 16918 | * Constant: '<S537>/Constant' |
| 16919 | */ |
| 16920 | L4_MABX_B.SPN545_EngineGainKpOfTheEndspee = L4_MABX_B.DataTypeConversion2_i * |
| 16921 | L4_MABX_P.Constant_Value_lk; |
| 16922 | |
| 16923 | /* DataTypeConversion: '<S424>/Data Type Conversion11' */ |
| 16924 | L4_MABX_B.DataTypeConversion11 = L4_MABX_B.SPN545_EngineGainKpOfTheEndspee; |
| 16925 | |
| 16926 | /* DataTypeConversion: '<S540>/Data Type Conversion1' */ |
| 16927 | L4_MABX_B.DataTypeConversion1_bu = L4_MABX_B.DataTypeConversion_bq[21]; |
| 16928 | |
| 16929 | /* DataTypeConversion: '<S540>/Data Type Conversion3' */ |
| 16930 | L4_MABX_B.DataTypeConversion3_b = L4_MABX_B.DataTypeConversion_bq[22]; |
| 16931 | |
| 16932 | /* ArithShift: '<S540>/Shift Arithmetic' */ |
| 16933 | L4_MABX_B.ShiftArithmetic_i = (uint16_T)(L4_MABX_B.DataTypeConversion3_b << 8); |
| 16934 | |
| 16935 | /* S-Function (sfix_bitop): '<S564>/Operator' */ |
| 16936 | L4_MABX_B.Operator_ha = (uint16_T)(L4_MABX_B.DataTypeConversion1_bu | |
| 16937 | L4_MABX_B.ShiftArithmetic_i); |
| 16938 | |
| 16939 | /* DataTypeConversion: '<S564>/DataType' */ |
| 16940 | L4_MABX_B.DataType_bi = L4_MABX_B.Operator_ha; |
| 16941 | |
| 16942 | /* DataTypeConversion: '<S540>/Data Type Conversion2' */ |
| 16943 | L4_MABX_B.DataTypeConversion2_a = L4_MABX_B.DataType_bi; |
| 16944 | |
| 16945 | /* Product: '<S540>/Product' incorporates: |
| 16946 | * Constant: '<S540>/Constant' |
| 16947 | */ |
| 16948 | L4_MABX_B.SPN533_EngineMaximumMomentaryOv = L4_MABX_B.DataTypeConversion2_a * |
| 16949 | L4_MABX_P.Constant_Value_on; |
| 16950 | |
| 16951 | /* DataTypeConversion: '<S424>/Data Type Conversion13' */ |
| 16952 | L4_MABX_B.DataTypeConversion13 = L4_MABX_B.SPN533_EngineMaximumMomentaryOv; |
| 16953 | |
| 16954 | /* DataTypeConversion: '<S541>/Data Type Conversion2' */ |
| 16955 | L4_MABX_B.DataTypeConversion2_e = L4_MABX_B.DataTypeConversion_bq[23]; |
| 16956 | |
| 16957 | /* Product: '<S541>/Product' incorporates: |
| 16958 | * Constant: '<S541>/Constant' |
| 16959 | */ |
| 16960 | L4_MABX_B.SPN534_EngineMaximumMomentaryOv = L4_MABX_B.DataTypeConversion2_e * |
| 16961 | L4_MABX_P.Constant_Value_gt; |
| 16962 | |
| 16963 | /* DataTypeConversion: '<S424>/Data Type Conversion14' */ |
| 16964 | L4_MABX_B.DataTypeConversion14 = L4_MABX_B.SPN534_EngineMaximumMomentaryOv; |
| 16965 | |
| 16966 | /* DataTypeConversion: '<S542>/Data Type Conversion2' */ |
| 16967 | L4_MABX_B.DataTypeConversion2_g = L4_MABX_B.DataTypeConversion_bq[24]; |
| 16968 | |
| 16969 | /* Product: '<S542>/Product' incorporates: |
| 16970 | * Constant: '<S542>/Constant' |
| 16971 | */ |
| 16972 | L4_MABX_B.SPN535_EngineRequestedSpeedCont = L4_MABX_B.DataTypeConversion2_g * |
| 16973 | L4_MABX_P.Constant_Value_n2; |
| 16974 | |
| 16975 | /* DataTypeConversion: '<S424>/Data Type Conversion15' */ |
| 16976 | L4_MABX_B.DataTypeConversion15 = L4_MABX_B.SPN535_EngineRequestedSpeedCont; |
| 16977 | |
| 16978 | /* DataTypeConversion: '<S543>/Data Type Conversion2' */ |
| 16979 | L4_MABX_B.DataTypeConversion2_fj = L4_MABX_B.DataTypeConversion_bq[25]; |
| 16980 | |
| 16981 | /* Product: '<S543>/Product' incorporates: |
| 16982 | * Constant: '<S543>/Constant' |
| 16983 | */ |
| 16984 | L4_MABX_B.SPN536_EngineRequestedSpeedCont = L4_MABX_B.DataTypeConversion2_fj * |
| 16985 | L4_MABX_P.Constant_Value_ah; |
| 16986 | |
| 16987 | /* DataTypeConversion: '<S424>/Data Type Conversion16' */ |
| 16988 | L4_MABX_B.DataTypeConversion16 = L4_MABX_B.SPN536_EngineRequestedSpeedCont; |
| 16989 | |
| 16990 | /* DataTypeConversion: '<S544>/Data Type Conversion' */ |
| 16991 | L4_MABX_B.DataTypeConversion_n = L4_MABX_B.DataTypeConversion_bq[26]; |
| 16992 | |
| 16993 | /* Sum: '<S544>/Add' incorporates: |
| 16994 | * Constant: '<S544>/Constant' |
| 16995 | */ |
| 16996 | L4_MABX_B.SPN537_EngineRequestedTorqueCon = L4_MABX_B.DataTypeConversion_n + |
| 16997 | L4_MABX_P.Constant_Value_jd; |
| 16998 | |
| 16999 | /* DataTypeConversion: '<S424>/Data Type Conversion17' */ |
| 17000 | L4_MABX_B.DataTypeConversion17 = L4_MABX_B.SPN537_EngineRequestedTorqueCon; |
| 17001 | |
| 17002 | /* DataTypeConversion: '<S545>/Data Type Conversion' */ |
| 17003 | L4_MABX_B.DataTypeConversion_i = L4_MABX_B.DataTypeConversion_bq[27]; |
| 17004 | |
| 17005 | /* Sum: '<S545>/Add' incorporates: |
| 17006 | * Constant: '<S545>/Constant' |
| 17007 | */ |
| 17008 | L4_MABX_B.SPN538_EngineRequestedTorqueCon = L4_MABX_B.DataTypeConversion_i + |
| 17009 | L4_MABX_P.Constant_Value_is; |
| 17010 | |
| 17011 | /* DataTypeConversion: '<S424>/Data Type Conversion18' */ |
| 17012 | L4_MABX_B.DataTypeConversion18 = L4_MABX_B.SPN538_EngineRequestedTorqueCon; |
| 17013 | |
| 17014 | /* DataTypeConversion: '<S546>/Data Type Conversion1' */ |
| 17015 | L4_MABX_B.DataTypeConversion1_iu = L4_MABX_B.DataTypeConversion_bq[28]; |
| 17016 | |
| 17017 | /* DataTypeConversion: '<S546>/Data Type Conversion3' */ |
| 17018 | L4_MABX_B.DataTypeConversion3_jk = L4_MABX_B.DataTypeConversion_bq[29]; |
| 17019 | |
| 17020 | /* ArithShift: '<S546>/Shift Arithmetic' */ |
| 17021 | L4_MABX_B.ShiftArithmetic_g = (uint16_T)(L4_MABX_B.DataTypeConversion3_jk << 8); |
| 17022 | |
| 17023 | /* S-Function (sfix_bitop): '<S565>/Operator' */ |
| 17024 | L4_MABX_B.Operator_bt = (uint16_T)(L4_MABX_B.DataTypeConversion1_iu | |
| 17025 | L4_MABX_B.ShiftArithmetic_g); |
| 17026 | |
| 17027 | /* DataTypeConversion: '<S565>/DataType' */ |
| 17028 | L4_MABX_B.DataType_dv = L4_MABX_B.Operator_bt; |
| 17029 | |
| 17030 | /* DataTypeConversion: '<S546>/Data Type Conversion2' */ |
| 17031 | L4_MABX_B.DataTypeConversion2_ae = L4_MABX_B.DataType_dv; |
| 17032 | |
| 17033 | /* Product: '<S546>/Product' incorporates: |
| 17034 | * Constant: '<S546>/Constant' |
| 17035 | */ |
| 17036 | L4_MABX_B.SPN1712_EngRequestedSpeedCtrlRn = L4_MABX_B.DataTypeConversion2_ae * |
| 17037 | L4_MABX_P.Constant_Value_o5; |
| 17038 | |
| 17039 | /* DataTypeConversion: '<S424>/Data Type Conversion19' */ |
| 17040 | L4_MABX_B.DataTypeConversion19 = L4_MABX_B.SPN1712_EngRequestedSpeedCtrlRn; |
| 17041 | |
| 17042 | /* DataTypeConversion: '<S554>/Data Type Conversion' */ |
| 17043 | L4_MABX_B.DataTypeConversion_ef = L4_MABX_B.DataTypeConversion_bq[3]; |
| 17044 | |
| 17045 | /* DataTypeConversion: '<S554>/Data Type Conversion1' */ |
| 17046 | L4_MABX_B.DataTypeConversion1_lg = L4_MABX_B.DataTypeConversion_bq[4]; |
| 17047 | |
| 17048 | /* ArithShift: '<S554>/Shift Arithmetic' */ |
| 17049 | L4_MABX_B.ShiftArithmetic_hv = (uint16_T)(L4_MABX_B.DataTypeConversion1_lg << |
| 17050 | 8); |
| 17051 | |
| 17052 | /* S-Function (sfix_bitop): '<S568>/Operator' */ |
| 17053 | L4_MABX_B.Operator_nd = (uint16_T)(L4_MABX_B.DataTypeConversion_ef | |
| 17054 | L4_MABX_B.ShiftArithmetic_hv); |
| 17055 | |
| 17056 | /* DataTypeConversion: '<S568>/DataType' */ |
| 17057 | L4_MABX_B.DataType_ak = L4_MABX_B.Operator_nd; |
| 17058 | |
| 17059 | /* DataTypeConversion: '<S554>/Data Type Conversion2' */ |
| 17060 | L4_MABX_B.DataTypeConversion2_n = L4_MABX_B.DataType_ak; |
| 17061 | |
| 17062 | /* Product: '<S554>/Product' incorporates: |
| 17063 | * Constant: '<S554>/Constant' |
| 17064 | */ |
| 17065 | L4_MABX_B.SPN528_EngineSpeedAtPoint2 = L4_MABX_B.DataTypeConversion2_n * |
| 17066 | L4_MABX_P.Constant_Value_gx; |
| 17067 | |
| 17068 | /* DataTypeConversion: '<S424>/Data Type Conversion2' */ |
| 17069 | L4_MABX_B.DataTypeConversion2_c = L4_MABX_B.SPN528_EngineSpeedAtPoint2; |
| 17070 | |
| 17071 | /* DataTypeConversion: '<S547>/Data Type Conversion1' */ |
| 17072 | L4_MABX_B.DataTypeConversion1_gi = L4_MABX_B.DataTypeConversion_bq[30]; |
| 17073 | |
| 17074 | /* DataTypeConversion: '<S547>/Data Type Conversion3' */ |
| 17075 | L4_MABX_B.DataTypeConversion3_d = L4_MABX_B.DataTypeConversion_bq[31]; |
| 17076 | |
| 17077 | /* ArithShift: '<S547>/Shift Arithmetic' */ |
| 17078 | L4_MABX_B.ShiftArithmetic_iu = (uint16_T)(L4_MABX_B.DataTypeConversion3_d << 8); |
| 17079 | |
| 17080 | /* S-Function (sfix_bitop): '<S566>/Operator' */ |
| 17081 | L4_MABX_B.Operator_gs = (uint16_T)(L4_MABX_B.DataTypeConversion1_gi | |
| 17082 | L4_MABX_B.ShiftArithmetic_iu); |
| 17083 | |
| 17084 | /* DataTypeConversion: '<S566>/DataType' */ |
| 17085 | L4_MABX_B.DataType_ec = L4_MABX_B.Operator_gs; |
| 17086 | |
| 17087 | /* DataTypeConversion: '<S547>/Data Type Conversion2' */ |
| 17088 | L4_MABX_B.DataTypeConversion2_h = L4_MABX_B.DataType_ec; |
| 17089 | |
| 17090 | /* Product: '<S547>/Product' incorporates: |
| 17091 | * Constant: '<S547>/Constant' |
| 17092 | */ |
| 17093 | L4_MABX_B.SPN1794_EngineMomentOfInertia = L4_MABX_B.DataTypeConversion2_h * |
| 17094 | L4_MABX_P.Constant_Value_l1; |
| 17095 | |
| 17096 | /* DataTypeConversion: '<S424>/Data Type Conversion20' */ |
| 17097 | L4_MABX_B.DataTypeConversion20 = L4_MABX_B.SPN1794_EngineMomentOfInertia; |
| 17098 | |
| 17099 | /* DataTypeConversion: '<S548>/Data Type Conversion' */ |
| 17100 | L4_MABX_B.DataTypeConversion_pf = L4_MABX_B.DataTypeConversion_bq[32]; |
| 17101 | |
| 17102 | /* DataTypeConversion: '<S548>/Data Type Conversion1' */ |
| 17103 | L4_MABX_B.DataTypeConversion1_kq = L4_MABX_B.DataTypeConversion_bq[33]; |
| 17104 | |
| 17105 | /* ArithShift: '<S548>/Shift Arithmetic' */ |
| 17106 | L4_MABX_B.ShiftArithmetic_n = (uint16_T)(L4_MABX_B.DataTypeConversion1_kq << 8); |
| 17107 | |
| 17108 | /* S-Function (sfix_bitop): '<S567>/Operator' */ |
| 17109 | L4_MABX_B.Operator_m = (uint16_T)(L4_MABX_B.DataTypeConversion_pf | |
| 17110 | L4_MABX_B.ShiftArithmetic_n); |
| 17111 | |
| 17112 | /* DataTypeConversion: '<S567>/DataType' */ |
| 17113 | L4_MABX_B.DataType_be = L4_MABX_B.Operator_m; |
| 17114 | |
| 17115 | /* DataTypeConversion: '<S548>/Data Type Conversion2' */ |
| 17116 | L4_MABX_B.SPN1846_EngineDefaultTorqueLimi = L4_MABX_B.DataType_be; |
| 17117 | |
| 17118 | /* DataTypeConversion: '<S424>/Data Type Conversion21' */ |
| 17119 | L4_MABX_B.DataTypeConversion21 = L4_MABX_B.SPN1846_EngineDefaultTorqueLimi; |
| 17120 | |
| 17121 | /* DataTypeConversion: '<S424>/Data Type Conversion22' */ |
| 17122 | L4_MABX_B.DataTypeConversion22 = L4_MABX_B.DataTypeConversion_bq[34]; |
| 17123 | |
| 17124 | /* DataTypeConversion: '<S424>/Data Type Conversion23' */ |
| 17125 | L4_MABX_B.DataTypeConversion23 = L4_MABX_B.DataTypeConversion_bq[35]; |
| 17126 | |
| 17127 | /* DataTypeConversion: '<S424>/Data Type Conversion24' */ |
| 17128 | L4_MABX_B.DataTypeConversion24 = L4_MABX_B.DataTypeConversion_bq[36]; |
| 17129 | |
| 17130 | /* DataTypeConversion: '<S424>/Data Type Conversion25' */ |
| 17131 | L4_MABX_B.DataTypeConversion25 = L4_MABX_B.DataTypeConversion_bq[37]; |
| 17132 | |
| 17133 | /* DataTypeConversion: '<S424>/Data Type Conversion26' */ |
| 17134 | L4_MABX_B.DataTypeConversion26 = L4_MABX_B.DataTypeConversion_bq[38]; |
| 17135 | |
| 17136 | /* DataTypeConversion: '<S555>/Data Type Conversion' */ |
| 17137 | L4_MABX_B.DataTypeConversion_b = L4_MABX_B.DataTypeConversion_bq[5]; |
| 17138 | |
| 17139 | /* Sum: '<S555>/Add' incorporates: |
| 17140 | * Constant: '<S555>/Constant' |
| 17141 | */ |
| 17142 | L4_MABX_B.SPN540_EnginePercentTorqueAtPoi = L4_MABX_B.DataTypeConversion_b + |
| 17143 | L4_MABX_P.Constant_Value_o4u; |
| 17144 | |
| 17145 | /* DataTypeConversion: '<S424>/Data Type Conversion3' */ |
| 17146 | L4_MABX_B.DataTypeConversion3 = L4_MABX_B.SPN540_EnginePercentTorqueAtPoi; |
| 17147 | |
| 17148 | /* DataTypeConversion: '<S556>/Data Type Conversion' */ |
| 17149 | L4_MABX_B.DataTypeConversion_eg = L4_MABX_B.DataTypeConversion_bq[6]; |
| 17150 | |
| 17151 | /* DataTypeConversion: '<S556>/Data Type Conversion1' */ |
| 17152 | L4_MABX_B.DataTypeConversion1_hy = L4_MABX_B.DataTypeConversion_bq[7]; |
| 17153 | |
| 17154 | /* ArithShift: '<S556>/Shift Arithmetic' */ |
| 17155 | L4_MABX_B.ShiftArithmetic_hk = (uint16_T)(L4_MABX_B.DataTypeConversion1_hy << |
| 17156 | 8); |
| 17157 | |
| 17158 | /* S-Function (sfix_bitop): '<S569>/Operator' */ |
| 17159 | L4_MABX_B.Operator_n1 = (uint16_T)(L4_MABX_B.DataTypeConversion_eg | |
| 17160 | L4_MABX_B.ShiftArithmetic_hk); |
| 17161 | |
| 17162 | /* DataTypeConversion: '<S569>/DataType' */ |
| 17163 | L4_MABX_B.DataType_bd = L4_MABX_B.Operator_n1; |
| 17164 | |
| 17165 | /* DataTypeConversion: '<S556>/Data Type Conversion2' */ |
| 17166 | L4_MABX_B.DataTypeConversion2_er = L4_MABX_B.DataType_bd; |
| 17167 | |
| 17168 | /* Product: '<S556>/Product' incorporates: |
| 17169 | * Constant: '<S556>/Constant' |
| 17170 | */ |
| 17171 | L4_MABX_B.SPN529_EngineSpeedAtPoint3 = L4_MABX_B.DataTypeConversion2_er * |
| 17172 | L4_MABX_P.Constant_Value_pr; |
| 17173 | |
| 17174 | /* DataTypeConversion: '<S424>/Data Type Conversion4' */ |
| 17175 | L4_MABX_B.DataTypeConversion4 = L4_MABX_B.SPN529_EngineSpeedAtPoint3; |
| 17176 | |
| 17177 | /* DataTypeConversion: '<S557>/Data Type Conversion' */ |
| 17178 | L4_MABX_B.DataTypeConversion_ce = L4_MABX_B.DataTypeConversion_bq[8]; |
| 17179 | |
| 17180 | /* Sum: '<S557>/Add' incorporates: |
| 17181 | * Constant: '<S557>/Constant' |
| 17182 | */ |
| 17183 | L4_MABX_B.SPN541_EnginePercentTorqueAtPoi = L4_MABX_B.DataTypeConversion_ce + |
| 17184 | L4_MABX_P.Constant_Value_gy; |
| 17185 | |
| 17186 | /* DataTypeConversion: '<S424>/Data Type Conversion5' */ |
| 17187 | L4_MABX_B.DataTypeConversion5 = L4_MABX_B.SPN541_EnginePercentTorqueAtPoi; |
| 17188 | |
| 17189 | /* DataTypeConversion: '<S558>/Data Type Conversion' */ |
| 17190 | L4_MABX_B.DataTypeConversion_kb = L4_MABX_B.DataTypeConversion_bq[9]; |
| 17191 | |
| 17192 | /* DataTypeConversion: '<S558>/Data Type Conversion1' */ |
| 17193 | L4_MABX_B.DataTypeConversion1_lr = L4_MABX_B.DataTypeConversion_bq[10]; |
| 17194 | |
| 17195 | /* ArithShift: '<S558>/Shift Arithmetic' */ |
| 17196 | L4_MABX_B.ShiftArithmetic_j = (uint16_T)(L4_MABX_B.DataTypeConversion1_lr << 8); |
| 17197 | |
| 17198 | /* S-Function (sfix_bitop): '<S570>/Operator' */ |
| 17199 | L4_MABX_B.Operator_ky = (uint16_T)(L4_MABX_B.DataTypeConversion_kb | |
| 17200 | L4_MABX_B.ShiftArithmetic_j); |
| 17201 | |
| 17202 | /* DataTypeConversion: '<S570>/DataType' */ |
| 17203 | L4_MABX_B.DataType_ax = L4_MABX_B.Operator_ky; |
| 17204 | |
| 17205 | /* DataTypeConversion: '<S558>/Data Type Conversion2' */ |
| 17206 | L4_MABX_B.DataTypeConversion2_h3 = L4_MABX_B.DataType_ax; |
| 17207 | |
| 17208 | /* Product: '<S558>/Product' incorporates: |
| 17209 | * Constant: '<S558>/Constant' |
| 17210 | */ |
| 17211 | L4_MABX_B.SPN530_EngineSpeedAtPoint4 = L4_MABX_B.DataTypeConversion2_h3 * |
| 17212 | L4_MABX_P.Constant_Value_nn; |
| 17213 | |
| 17214 | /* DataTypeConversion: '<S424>/Data Type Conversion6' */ |
| 17215 | L4_MABX_B.DataTypeConversion6 = L4_MABX_B.SPN530_EngineSpeedAtPoint4; |
| 17216 | |
| 17217 | /* DataTypeConversion: '<S533>/Data Type Conversion' */ |
| 17218 | L4_MABX_B.DataTypeConversion_j = L4_MABX_B.DataTypeConversion_bq[11]; |
| 17219 | |
| 17220 | /* Sum: '<S533>/Add' incorporates: |
| 17221 | * Constant: '<S533>/Constant' |
| 17222 | */ |
| 17223 | L4_MABX_B.SPN542_EnginePercentTorqueAtPoi = L4_MABX_B.DataTypeConversion_j + |
| 17224 | L4_MABX_P.Constant_Value_m; |
| 17225 | |
| 17226 | /* DataTypeConversion: '<S424>/Data Type Conversion7' */ |
| 17227 | L4_MABX_B.DataTypeConversion7 = L4_MABX_B.SPN542_EnginePercentTorqueAtPoi; |
| 17228 | |
| 17229 | /* DataTypeConversion: '<S534>/Data Type Conversion' */ |
| 17230 | L4_MABX_B.DataTypeConversion_ov = L4_MABX_B.DataTypeConversion_bq[12]; |
| 17231 | |
| 17232 | /* DataTypeConversion: '<S534>/Data Type Conversion1' */ |
| 17233 | L4_MABX_B.DataTypeConversion1_fe = L4_MABX_B.DataTypeConversion_bq[13]; |
| 17234 | |
| 17235 | /* ArithShift: '<S534>/Shift Arithmetic' */ |
| 17236 | L4_MABX_B.ShiftArithmetic_j1 = (uint16_T)(L4_MABX_B.DataTypeConversion1_fe << |
| 17237 | 8); |
| 17238 | |
| 17239 | /* S-Function (sfix_bitop): '<S560>/Operator' */ |
| 17240 | L4_MABX_B.Operator_hk = (uint16_T)(L4_MABX_B.DataTypeConversion_ov | |
| 17241 | L4_MABX_B.ShiftArithmetic_j1); |
| 17242 | |
| 17243 | /* DataTypeConversion: '<S560>/DataType' */ |
| 17244 | L4_MABX_B.DataType_fv = L4_MABX_B.Operator_hk; |
| 17245 | |
| 17246 | /* DataTypeConversion: '<S534>/Data Type Conversion2' */ |
| 17247 | L4_MABX_B.DataTypeConversion2_p = L4_MABX_B.DataType_fv; |
| 17248 | |
| 17249 | /* Product: '<S534>/Product' incorporates: |
| 17250 | * Constant: '<S534>/Constant' |
| 17251 | */ |
| 17252 | L4_MABX_B.SPN531_EngineSpeedAtPoint5 = L4_MABX_B.DataTypeConversion2_p * |
| 17253 | L4_MABX_P.Constant_Value_ob; |
| 17254 | |
| 17255 | /* DataTypeConversion: '<S424>/Data Type Conversion8' */ |
| 17256 | L4_MABX_B.DataTypeConversion8 = L4_MABX_B.SPN531_EngineSpeedAtPoint5; |
| 17257 | |
| 17258 | /* DataTypeConversion: '<S535>/Data Type Conversion' */ |
| 17259 | L4_MABX_B.DataTypeConversion_dt = L4_MABX_B.DataTypeConversion_bq[14]; |
| 17260 | |
| 17261 | /* Sum: '<S535>/Add' incorporates: |
| 17262 | * Constant: '<S535>/Constant' |
| 17263 | */ |
| 17264 | L4_MABX_B.SPN543_EnginePercentTorqueAtPoi = L4_MABX_B.DataTypeConversion_dt + |
| 17265 | L4_MABX_P.Constant_Value_pn; |
| 17266 | |
| 17267 | /* DataTypeConversion: '<S424>/Data Type Conversion9' */ |
| 17268 | L4_MABX_B.DataTypeConversion9 = L4_MABX_B.SPN543_EnginePercentTorqueAtPoi; |
| 17269 | |
| 17270 | /* DataTypeConversion: '<S481>/Data Type Conversion8' */ |
| 17271 | L4_MABX_B.RX_status_p = (L4_MABX_B.SFunction1_o9_ad != 0.0); |
| 17272 | |
| 17273 | /* MultiPortSwitch: '<S427>/Multiport_Switch' */ |
| 17274 | L4_MABX_B.RX_status_gp = L4_MABX_B.RX_status_p; |
| 17275 | |
| 17276 | /* DataTypeConversion: '<S481>/Data Type Conversion9' */ |
| 17277 | L4_MABX_B.RX_time = L4_MABX_B.SFunction1_o10_n; |
| 17278 | |
| 17279 | /* MultiPortSwitch: '<S427>/Multiport_Switch' */ |
| 17280 | L4_MABX_B.RX_time_p = L4_MABX_B.RX_time; |
| 17281 | |
| 17282 | /* DataTypeConversion: '<S481>/Data Type Conversion10' */ |
| 17283 | L4_MABX_B.RX_delta_time = L4_MABX_B.SFunction1_o11_p; |
| 17284 | |
| 17285 | /* MultiPortSwitch: '<S427>/Multiport_Switch' */ |
| 17286 | L4_MABX_B.RX_delta_time_c = L4_MABX_B.RX_delta_time; |
| 17287 | |
| 17288 | /* RelationalOperator: '<S485>/Operator' incorporates: |
| 17289 | * Constant: '<S427>/Constant' |
| 17290 | * Constant: '<S482>/Constant1' |
| 17291 | */ |
| 17292 | L4_MABX_B.Operator_pa = (L4_MABX_P.Constant_Value_by3 == |
| 17293 | L4_MABX_P.Constant1_Value_bd); |
| 17294 | |
| 17295 | /* RelationalOperator: '<S486>/Operator' incorporates: |
| 17296 | * Constant: '<S427>/Constant' |
| 17297 | * Constant: '<S482>/Constant2' |
| 17298 | */ |
| 17299 | L4_MABX_B.Operator_hf = (L4_MABX_P.Constant_Value_by3 == |
| 17300 | L4_MABX_P.Constant2_Value_ar); |
| 17301 | |
| 17302 | /* RelationalOperator: '<S487>/Operator' incorporates: |
| 17303 | * Constant: '<S427>/Constant' |
| 17304 | * Constant: '<S482>/Constant3' |
| 17305 | */ |
| 17306 | L4_MABX_B.Operator_cuv = (L4_MABX_P.Constant_Value_by3 == |
| 17307 | L4_MABX_P.Constant3_Value_d1); |
| 17308 | |
| 17309 | /* RelationalOperator: '<S488>/Operator' incorporates: |
| 17310 | * Constant: '<S427>/Constant' |
| 17311 | * Constant: '<S482>/Constant4' |
| 17312 | */ |
| 17313 | L4_MABX_B.Operator_ca = (L4_MABX_P.Constant_Value_by3 == |
| 17314 | L4_MABX_P.Constant4_Value_i); |
| 17315 | |
| 17316 | /* RelationalOperator: '<S489>/Operator' incorporates: |
| 17317 | * Constant: '<S427>/Constant' |
| 17318 | * Constant: '<S482>/Constant5' |
| 17319 | */ |
| 17320 | L4_MABX_B.Operator_k2 = (L4_MABX_P.Constant_Value_by3 == |
| 17321 | L4_MABX_P.Constant5_Value_c); |
| 17322 | |
| 17323 | /* DataTypeConversion: '<S490>/Data Type Conversion9' */ |
| 17324 | L4_MABX_B.RX_time_g = L4_MABX_B.SFunction1_o10_hj; |
| 17325 | |
| 17326 | /* MultiPortSwitch: '<S428>/Multiport_Switch' */ |
| 17327 | L4_MABX_B.RX_time_l = L4_MABX_B.RX_time_g; |
| 17328 | |
| 17329 | /* DataTypeConversion: '<S490>/Data Type Conversion10' */ |
| 17330 | L4_MABX_B.RX_delta_time_o = L4_MABX_B.SFunction1_o11_h; |
| 17331 | |
| 17332 | /* MultiPortSwitch: '<S428>/Multiport_Switch' */ |
| 17333 | L4_MABX_B.RX_delta_time_j = L4_MABX_B.RX_delta_time_o; |
| 17334 | |
| 17335 | /* RelationalOperator: '<S494>/Operator' incorporates: |
| 17336 | * Constant: '<S428>/Constant' |
| 17337 | * Constant: '<S491>/Constant1' |
| 17338 | */ |
| 17339 | L4_MABX_B.Operator_dbr = (L4_MABX_P.Constant_Value_ek == |
| 17340 | L4_MABX_P.Constant1_Value_d); |
| 17341 | |
| 17342 | /* RelationalOperator: '<S495>/Operator' incorporates: |
| 17343 | * Constant: '<S428>/Constant' |
| 17344 | * Constant: '<S491>/Constant2' |
| 17345 | */ |
| 17346 | L4_MABX_B.Operator_hfh = (L4_MABX_P.Constant_Value_ek == |
| 17347 | L4_MABX_P.Constant2_Value_pr); |
| 17348 | |
| 17349 | /* RelationalOperator: '<S496>/Operator' incorporates: |
| 17350 | * Constant: '<S428>/Constant' |
| 17351 | * Constant: '<S491>/Constant3' |
| 17352 | */ |
| 17353 | L4_MABX_B.Operator_my = (L4_MABX_P.Constant_Value_ek == |
| 17354 | L4_MABX_P.Constant3_Value_o); |
| 17355 | |
| 17356 | /* RelationalOperator: '<S497>/Operator' incorporates: |
| 17357 | * Constant: '<S428>/Constant' |
| 17358 | * Constant: '<S491>/Constant4' |
| 17359 | */ |
| 17360 | L4_MABX_B.Operator_ayb = (L4_MABX_P.Constant_Value_ek == |
| 17361 | L4_MABX_P.Constant4_Value_f); |
| 17362 | |
| 17363 | /* RelationalOperator: '<S498>/Operator' incorporates: |
| 17364 | * Constant: '<S428>/Constant' |
| 17365 | * Constant: '<S491>/Constant5' |
| 17366 | */ |
| 17367 | L4_MABX_B.Operator_aw = (L4_MABX_P.Constant_Value_ek == |
| 17368 | L4_MABX_P.Constant5_Value_pd); |
| 17369 | |
| 17370 | /* DataTypeConversion: '<S499>/Data Type Conversion1' */ |
| 17371 | L4_MABX_B.SpeedOfForwardVehicle = L4_MABX_B.SFunction1_o1_de; |
| 17372 | |
| 17373 | /* DataTypeConversion: '<S499>/Data Type Conversion10' */ |
| 17374 | L4_MABX_B.RX_delta_time_a = L4_MABX_B.SFunction1_o13_or; |
| 17375 | |
| 17376 | /* DataTypeConversion: '<S499>/Data Type Conversion11' */ |
| 17377 | L4_MABX_B.ACCSystemShutoffWarning = L4_MABX_B.SFunction1_o8_oi; |
| 17378 | |
| 17379 | /* DataTypeConversion: '<S499>/Data Type Conversion2' */ |
| 17380 | L4_MABX_B.DistanceToForwardVehicle = L4_MABX_B.SFunction1_o2_d5; |
| 17381 | |
| 17382 | /* DataTypeConversion: '<S499>/Data Type Conversion3' */ |
| 17383 | L4_MABX_B.AdaptiveCruiseCtrlSetSpeed = L4_MABX_B.SFunction1_o3_dg; |
| 17384 | |
| 17385 | /* DataTypeConversion: '<S499>/Data Type Conversion4' */ |
| 17386 | L4_MABX_B.AdaptiveCruiseCtrlMode = L4_MABX_B.SFunction1_o4_bc; |
| 17387 | |
| 17388 | /* DataTypeConversion: '<S499>/Data Type Conversion5' */ |
| 17389 | L4_MABX_B.AdptveCruiseCtrlSetDistanceMode = L4_MABX_B.SFunction1_o5_k4; |
| 17390 | |
| 17391 | /* DataTypeConversion: '<S499>/Data Type Conversion6' */ |
| 17392 | L4_MABX_B.RoadCurvature = L4_MABX_B.SFunction1_o6_j5; |
| 17393 | |
| 17394 | /* DataTypeConversion: '<S499>/Data Type Conversion7' */ |
| 17395 | L4_MABX_B.ACCTargetDetected = L4_MABX_B.SFunction1_o7_hh; |
| 17396 | |
| 17397 | /* DataTypeConversion: '<S499>/Data Type Conversion8' */ |
| 17398 | L4_MABX_B.RX_status_k = (L4_MABX_B.SFunction1_o11_mg != 0.0); |
| 17399 | |
| 17400 | /* DataTypeConversion: '<S499>/Data Type Conversion9' */ |
| 17401 | L4_MABX_B.RX_time_m = L4_MABX_B.SFunction1_o12_n; |
| 17402 | |
| 17403 | /* Outputs for Enabled SubSystem: '<S501>/AEBS1_A0' incorporates: |
| 17404 | * EnablePort: '<S502>/Enable' |
| 17405 | */ |
| 17406 | /* Constant: '<S430>/Constant' */ |
| 17407 | if (L4_MABX_P.Constant_Value_nd) { |
| 17408 | /* S-Function (rti_commonblock): '<S502>/S-Function1' */ |
| 17409 | /* This comment workarounds a code generation problem */ |
| 17410 | |
| 17411 | /* dSPACE RTICAN RX Message Block: "AEBS1_A0" Id:217067306 */ |
| 17412 | { |
| 17413 | UInt32 *CAN_Msg; |
| 17414 | static dsfloat time_old = 0.0; |
| 17415 | |
| 17416 | /* Read status and timestamp info (previous message) */ |
| 17417 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02F2A].timestamp != |
| 17418 | time_old) { |
| 17419 | /* ... save timestamp info for the calculation of the RX status |
| 17420 | during the consecutive sample hit*/ |
| 17421 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02F2A]. |
| 17422 | timestamp; |
| 17423 | |
| 17424 | /* ... set the processed flag to one */ |
| 17425 | L4_MABX_B.SFunction1_o6_pv = 1.0; |
| 17426 | L4_MABX_B.SFunction1_o7_jm = (real_T) |
| 17427 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02F2A].timestamp; |
| 17428 | L4_MABX_B.SFunction1_o8_cl = (real_T) |
| 17429 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02F2A].deltatime; |
| 17430 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02F2A].data; |
| 17431 | |
| 17432 | /* Decode CAN message */ |
| 17433 | { |
| 17434 | { |
| 17435 | rtican_Signal_t CAN_Sgn; |
| 17436 | |
| 17437 | /* ...... "AdvEmergencyBrkSysState" (0|4, standard signal, unsigned int, little endian) */ |
| 17438 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 17439 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 17440 | L4_MABX_B.SFunction1_o1_jc = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17441 | |
| 17442 | /* ...... "CollisionWarningLevel" (4|4, standard signal, unsigned int, little endian) */ |
| 17443 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 17444 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 17445 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 17446 | L4_MABX_B.SFunction1_o2_pw = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17447 | |
| 17448 | /* ...... "RelObjctDetForAdvEmergBrakingSys" (8|3, standard signal, unsigned int, little endian) */ |
| 17449 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 17450 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 17451 | L4_MABX_B.SFunction1_o3_km = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17452 | |
| 17453 | /* ...... "BendOffProbabOfRelevantObject" (12|3, standard signal, unsigned int, little endian) */ |
| 17454 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 17455 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 17456 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 17457 | L4_MABX_B.SFunction1_o4_ke = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17458 | |
| 17459 | /* ...... "TimeToCollisionWithRelevantObj" (16|8, standard signal, unsigned int, little endian) */ |
| 17460 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 17461 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17462 | L4_MABX_B.SFunction1_o5_pv = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17463 | } |
| 17464 | } |
| 17465 | } else { |
| 17466 | /* set RX status to 0 because no new message has arrived */ |
| 17467 | L4_MABX_B.SFunction1_o6_pv = 0.0; |
| 17468 | } |
| 17469 | } |
| 17470 | } |
| 17471 | |
| 17472 | /* End of Constant: '<S430>/Constant' */ |
| 17473 | /* End of Outputs for SubSystem: '<S501>/AEBS1_A0' */ |
| 17474 | |
| 17475 | /* DataTypeConversion: '<S501>/Data Type Conversion10' */ |
| 17476 | L4_MABX_B.RX_delta_time_d = L4_MABX_B.SFunction1_o8_cl; |
| 17477 | |
| 17478 | /* DataTypeConversion: '<S501>/Data Type Conversion8' */ |
| 17479 | L4_MABX_B.RX_status_l = (L4_MABX_B.SFunction1_o6_pv != 0.0); |
| 17480 | |
| 17481 | /* DataTypeConversion: '<S501>/Data Type Conversion9' */ |
| 17482 | L4_MABX_B.RX_time_n = L4_MABX_B.SFunction1_o7_jm; |
| 17483 | |
| 17484 | /* DataTypeConversion: '<S503>/Data Type Conversion10' */ |
| 17485 | L4_MABX_B.RX_delta_time_de = L4_MABX_B.SFunction1_o11_a3; |
| 17486 | |
| 17487 | /* DataTypeConversion: '<S503>/Data Type Conversion8' */ |
| 17488 | L4_MABX_B.RX_status_gx = (L4_MABX_B.SFunction1_o9_kh != 0.0); |
| 17489 | |
| 17490 | /* DataTypeConversion: '<S503>/Data Type Conversion9' */ |
| 17491 | L4_MABX_B.RX_time_nm = L4_MABX_B.SFunction1_o10_dt; |
| 17492 | |
| 17493 | /* DataTypeConversion: '<S505>/Data Type Conversion10' */ |
| 17494 | L4_MABX_B.RX_delta_time_k = L4_MABX_B.SFunction1_o8_i; |
| 17495 | |
| 17496 | /* DataTypeConversion: '<S505>/Data Type Conversion8' */ |
| 17497 | L4_MABX_B.RX_status_c = (L4_MABX_B.SFunction1_o6_j0 != 0.0); |
| 17498 | |
| 17499 | /* DataTypeConversion: '<S505>/Data Type Conversion9' */ |
| 17500 | L4_MABX_B.RX_time_i = L4_MABX_B.SFunction1_o7_m; |
| 17501 | |
| 17502 | /* Outputs for Enabled SubSystem: '<S507>/B2' incorporates: |
| 17503 | * EnablePort: '<S508>/Enable' |
| 17504 | */ |
| 17505 | /* Constant: '<S433>/Constant' */ |
| 17506 | if (L4_MABX_P.Constant_Value_it > 0.0) { |
| 17507 | /* S-Function (rti_commonblock): '<S508>/S-Function1' */ |
| 17508 | /* This comment workarounds a code generation problem */ |
| 17509 | |
| 17510 | /* dSPACE RTICAN RX Message Block: "B2" Id:418451505 */ |
| 17511 | { |
| 17512 | UInt32 *CAN_Msg; |
| 17513 | static dsfloat time_old = 0.0; |
| 17514 | |
| 17515 | /* Read status and timestamp info (previous message) */ |
| 17516 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F11031].timestamp != |
| 17517 | time_old) { |
| 17518 | /* ... save timestamp info for the calculation of the RX status |
| 17519 | during the consecutive sample hit*/ |
| 17520 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F11031]. |
| 17521 | timestamp; |
| 17522 | |
| 17523 | /* ... set the processed flag to one */ |
| 17524 | L4_MABX_B.SFunction1_o3_o1 = 1.0; |
| 17525 | L4_MABX_B.SFunction1_o4_md = (real_T) |
| 17526 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F11031].timestamp; |
| 17527 | L4_MABX_B.SFunction1_o5_lj = (real_T) |
| 17528 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F11031].deltatime; |
| 17529 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F11031].data; |
| 17530 | |
| 17531 | /* Decode CAN message */ |
| 17532 | { |
| 17533 | { |
| 17534 | rtican_Signal_t CAN_Sgn; |
| 17535 | |
| 17536 | /* ...... "BrakeAppPressDemanded" (0|16, standard signal, unsigned int, little endian) */ |
| 17537 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 17538 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 17539 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17540 | L4_MABX_B.SFunction1_o1_pc = 0.1 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 17541 | |
| 17542 | /* ...... "BrakeSwitch2" (16|2, standard signal, unsigned int, little endian) */ |
| 17543 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 17544 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 17545 | L4_MABX_B.SFunction1_o2_bz = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17546 | } |
| 17547 | } |
| 17548 | } else { |
| 17549 | /* set RX status to 0 because no new message has arrived */ |
| 17550 | L4_MABX_B.SFunction1_o3_o1 = 0.0; |
| 17551 | } |
| 17552 | } |
| 17553 | } |
| 17554 | |
| 17555 | /* End of Constant: '<S433>/Constant' */ |
| 17556 | /* End of Outputs for SubSystem: '<S507>/B2' */ |
| 17557 | |
| 17558 | /* DataTypeConversion: '<S507>/Data Type Conversion10' */ |
| 17559 | L4_MABX_B.RX_delta_time_jt = L4_MABX_B.SFunction1_o5_lj; |
| 17560 | |
| 17561 | /* DataTypeConversion: '<S507>/Data Type Conversion8' */ |
| 17562 | L4_MABX_B.RX_status_h4 = (L4_MABX_B.SFunction1_o3_o1 != 0.0); |
| 17563 | |
| 17564 | /* DataTypeConversion: '<S507>/Data Type Conversion9' */ |
| 17565 | L4_MABX_B.RX_time_pq = L4_MABX_B.SFunction1_o4_md; |
| 17566 | |
| 17567 | /* Outputs for Enabled SubSystem: '<S509>/Tracks' incorporates: |
| 17568 | * EnablePort: '<S510>/Enable' |
| 17569 | */ |
| 17570 | /* Constant: '<S434>/Constant' */ |
| 17571 | if (L4_MABX_P.Constant_Value_a0) { |
| 17572 | /* S-Function (rti_commonblock): '<S510>/S-Function1' */ |
| 17573 | /* This comment workarounds a code generation problem */ |
| 17574 | |
| 17575 | /* dSPACE RTICAN RX Message Block: "Tracks" Id:1635 */ |
| 17576 | { |
| 17577 | UInt32 *CAN_Msg; |
| 17578 | static dsfloat time_old = 0.0; |
| 17579 | |
| 17580 | /* Read status and timestamp info (previous message) */ |
| 17581 | if (can_type1_M2_C1_STD[CANTP1_M2_C1_RXSRVC_STD_0x663].timestamp != |
| 17582 | time_old) { |
| 17583 | /* ... save timestamp info for the calculation of the RX status |
| 17584 | during the consecutive sample hit*/ |
| 17585 | time_old = can_type1_M2_C1_STD[CANTP1_M2_C1_RXSRVC_STD_0x663].timestamp; |
| 17586 | |
| 17587 | /* ... set the processed flag to one */ |
| 17588 | L4_MABX_B.SFunction1_o72 = 1.0; |
| 17589 | L4_MABX_B.SFunction1_o73 = (real_T) |
| 17590 | can_type1_M2_C1_STD[CANTP1_M2_C1_RXSRVC_STD_0x663].timestamp; |
| 17591 | L4_MABX_B.SFunction1_o74 = (real_T) |
| 17592 | can_type1_M2_C1_STD[CANTP1_M2_C1_RXSRVC_STD_0x663].deltatime; |
| 17593 | CAN_Msg = can_type1_M2_C1_STD[CANTP1_M2_C1_RXSRVC_STD_0x663].data; |
| 17594 | |
| 17595 | /* Decode CAN message */ |
| 17596 | { |
| 17597 | { |
| 17598 | rtican_Signal_t CAN_Sgn; |
| 17599 | UInt32 modeSignal; |
| 17600 | |
| 17601 | /* ...... "track_multiplexor" (56|8, mode signal, unsigned int, motorola back.) */ |
| 17602 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 17603 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17604 | L4_MABX_B.SFunction1_o71 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17605 | modeSignal = (UInt32) L4_MABX_B.SFunction1_o71; |
| 17606 | if (modeSignal == 4) { |
| 17607 | /* ...... "tr0_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17608 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17609 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17610 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17611 | L4_MABX_B.SFunction1_o1_ly = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17612 | } |
| 17613 | |
| 17614 | if (modeSignal == 5) { |
| 17615 | /* ...... "tr0_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17616 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17617 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17618 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17619 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17620 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17621 | } |
| 17622 | |
| 17623 | L4_MABX_B.SFunction1_o2_fl = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17624 | ); |
| 17625 | } |
| 17626 | |
| 17627 | if (modeSignal == 12) { |
| 17628 | /* ...... "tr1_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17629 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17630 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17631 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17632 | L4_MABX_B.SFunction1_o3_os = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17633 | } |
| 17634 | |
| 17635 | if (modeSignal == 13) { |
| 17636 | /* ...... "tr1_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17637 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17638 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17639 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17640 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17641 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17642 | } |
| 17643 | |
| 17644 | L4_MABX_B.SFunction1_o4_dz = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17645 | ); |
| 17646 | } |
| 17647 | |
| 17648 | if (modeSignal == 20) { |
| 17649 | /* ...... "tr2_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17650 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17651 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17652 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17653 | L4_MABX_B.SFunction1_o5_pr = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17654 | } |
| 17655 | |
| 17656 | if (modeSignal == 21) { |
| 17657 | /* ...... "tr2_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17658 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17659 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17660 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17661 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17662 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17663 | } |
| 17664 | |
| 17665 | L4_MABX_B.SFunction1_o6_hf = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17666 | ); |
| 17667 | } |
| 17668 | |
| 17669 | if (modeSignal == 28) { |
| 17670 | /* ...... "tr3_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17671 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17672 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17673 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17674 | L4_MABX_B.SFunction1_o7_pz = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17675 | } |
| 17676 | |
| 17677 | if (modeSignal == 29) { |
| 17678 | /* ...... "tr3_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17679 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17680 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17681 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17682 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17683 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17684 | } |
| 17685 | |
| 17686 | L4_MABX_B.SFunction1_o8_g = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17687 | ); |
| 17688 | } |
| 17689 | |
| 17690 | if (modeSignal == 36) { |
| 17691 | /* ...... "tr4_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17692 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17693 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17694 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17695 | L4_MABX_B.SFunction1_o9_g5 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17696 | } |
| 17697 | |
| 17698 | if (modeSignal == 37) { |
| 17699 | /* ...... "tr4_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17700 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17701 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17702 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17703 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17704 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17705 | } |
| 17706 | |
| 17707 | L4_MABX_B.SFunction1_o10_d5 = 0.001 * ( ((real_T) |
| 17708 | CAN_Sgn.SignedSgn) ); |
| 17709 | } |
| 17710 | |
| 17711 | if (modeSignal == 44) { |
| 17712 | /* ...... "tr5_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17713 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17714 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17715 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17716 | L4_MABX_B.SFunction1_o11_by = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17717 | } |
| 17718 | |
| 17719 | if (modeSignal == 45) { |
| 17720 | /* ...... "tr5_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17721 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17722 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17723 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17724 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17725 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17726 | } |
| 17727 | |
| 17728 | L4_MABX_B.SFunction1_o12_b = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17729 | ); |
| 17730 | } |
| 17731 | |
| 17732 | if (modeSignal == 52) { |
| 17733 | /* ...... "tr6_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17734 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17735 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17736 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17737 | L4_MABX_B.SFunction1_o13_g0 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17738 | } |
| 17739 | |
| 17740 | if (modeSignal == 53) { |
| 17741 | /* ...... "tr6_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17742 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17743 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17744 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17745 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17746 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17747 | } |
| 17748 | |
| 17749 | L4_MABX_B.SFunction1_o14_nc = 0.001 * ( ((real_T) |
| 17750 | CAN_Sgn.SignedSgn) ); |
| 17751 | } |
| 17752 | |
| 17753 | if (modeSignal == 60) { |
| 17754 | /* ...... "tr7_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17755 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17756 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17757 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17758 | L4_MABX_B.SFunction1_o15_ag = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17759 | } |
| 17760 | |
| 17761 | if (modeSignal == 61) { |
| 17762 | /* ...... "tr7_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17763 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17764 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17765 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17766 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17767 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17768 | } |
| 17769 | |
| 17770 | L4_MABX_B.SFunction1_o16_c = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17771 | ); |
| 17772 | } |
| 17773 | |
| 17774 | if (modeSignal == 68) { |
| 17775 | /* ...... "tr8_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17776 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17777 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17778 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17779 | L4_MABX_B.SFunction1_o17_b = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17780 | } |
| 17781 | |
| 17782 | if (modeSignal == 69) { |
| 17783 | /* ...... "tr8_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17784 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17785 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17786 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17787 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17788 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17789 | } |
| 17790 | |
| 17791 | L4_MABX_B.SFunction1_o18_b = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17792 | ); |
| 17793 | } |
| 17794 | |
| 17795 | if (modeSignal == 76) { |
| 17796 | /* ...... "tr9_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17797 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17798 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17799 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17800 | L4_MABX_B.SFunction1_o19_n = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17801 | } |
| 17802 | |
| 17803 | if (modeSignal == 77) { |
| 17804 | /* ...... "tr9_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17805 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17806 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17807 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17808 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17809 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17810 | } |
| 17811 | |
| 17812 | L4_MABX_B.SFunction1_o20_j = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17813 | ); |
| 17814 | } |
| 17815 | |
| 17816 | if (modeSignal == 6) { |
| 17817 | /* ...... "tr0_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17818 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17819 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17820 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17821 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17822 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17823 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17824 | } |
| 17825 | |
| 17826 | L4_MABX_B.SFunction1_o21_e5 = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17827 | ); |
| 17828 | } |
| 17829 | |
| 17830 | if (modeSignal == 14) { |
| 17831 | /* ...... "tr1_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17832 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17833 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17834 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17835 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17836 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17837 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17838 | } |
| 17839 | |
| 17840 | L4_MABX_B.SFunction1_o22_f = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17841 | } |
| 17842 | |
| 17843 | if (modeSignal == 22) { |
| 17844 | /* ...... "tr2_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17845 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17846 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17847 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17848 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17849 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17850 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17851 | } |
| 17852 | |
| 17853 | L4_MABX_B.SFunction1_o23_e = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17854 | } |
| 17855 | |
| 17856 | if (modeSignal == 30) { |
| 17857 | /* ...... "tr3_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17858 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17859 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17860 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17861 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17862 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17863 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17864 | } |
| 17865 | |
| 17866 | L4_MABX_B.SFunction1_o24_g = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17867 | } |
| 17868 | |
| 17869 | if (modeSignal == 38) { |
| 17870 | /* ...... "tr4_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17871 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17872 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17873 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17874 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17875 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17876 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17877 | } |
| 17878 | |
| 17879 | L4_MABX_B.SFunction1_o25_b = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17880 | } |
| 17881 | |
| 17882 | if (modeSignal == 46) { |
| 17883 | /* ...... "tr5_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17884 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17885 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17886 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17887 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17888 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17889 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17890 | } |
| 17891 | |
| 17892 | L4_MABX_B.SFunction1_o26_l = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17893 | } |
| 17894 | |
| 17895 | if (modeSignal == 54) { |
| 17896 | /* ...... "tr6_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17897 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17898 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17899 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17900 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17901 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17902 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17903 | } |
| 17904 | |
| 17905 | L4_MABX_B.SFunction1_o27_h = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17906 | } |
| 17907 | |
| 17908 | if (modeSignal == 62) { |
| 17909 | /* ...... "tr7_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17910 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17911 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17912 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17913 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17914 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17915 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17916 | } |
| 17917 | |
| 17918 | L4_MABX_B.SFunction1_o28_f = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17919 | } |
| 17920 | |
| 17921 | if (modeSignal == 70) { |
| 17922 | /* ...... "tr8_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17923 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17924 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17925 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17926 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17927 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17928 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17929 | } |
| 17930 | |
| 17931 | L4_MABX_B.SFunction1_o29 = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17932 | } |
| 17933 | |
| 17934 | if (modeSignal == 78) { |
| 17935 | /* ...... "tr9_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17936 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17937 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17938 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17939 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17940 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17941 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17942 | } |
| 17943 | |
| 17944 | L4_MABX_B.SFunction1_o30 = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17945 | } |
| 17946 | |
| 17947 | if (modeSignal == 4) { |
| 17948 | /* ...... "tr0_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 17949 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 17950 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 17951 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17952 | L4_MABX_B.SFunction1_o31 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 17953 | ); |
| 17954 | } |
| 17955 | |
| 17956 | if (modeSignal == 12) { |
| 17957 | /* ...... "tr1_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 17958 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 17959 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 17960 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17961 | L4_MABX_B.SFunction1_o32 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 17962 | ); |
| 17963 | } |
| 17964 | |
| 17965 | if (modeSignal == 20) { |
| 17966 | /* ...... "tr2_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 17967 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 17968 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 17969 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17970 | L4_MABX_B.SFunction1_o33 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 17971 | ); |
| 17972 | } |
| 17973 | |
| 17974 | if (modeSignal == 28) { |
| 17975 | /* ...... "tr3_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 17976 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 17977 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 17978 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17979 | L4_MABX_B.SFunction1_o34 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 17980 | ); |
| 17981 | } |
| 17982 | |
| 17983 | if (modeSignal == 36) { |
| 17984 | /* ...... "tr4_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 17985 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 17986 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 17987 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17988 | L4_MABX_B.SFunction1_o35 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 17989 | ); |
| 17990 | } |
| 17991 | |
| 17992 | if (modeSignal == 44) { |
| 17993 | /* ...... "tr5_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 17994 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 17995 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 17996 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17997 | L4_MABX_B.SFunction1_o36 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 17998 | ); |
| 17999 | } |
| 18000 | |
| 18001 | if (modeSignal == 52) { |
| 18002 | /* ...... "tr6_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 18003 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18004 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 18005 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 18006 | L4_MABX_B.SFunction1_o37 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 18007 | ); |
| 18008 | } |
| 18009 | |
| 18010 | if (modeSignal == 60) { |
| 18011 | /* ...... "tr7_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 18012 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18013 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 18014 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 18015 | L4_MABX_B.SFunction1_o38 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 18016 | ); |
| 18017 | } |
| 18018 | |
| 18019 | if (modeSignal == 68) { |
| 18020 | /* ...... "tr8_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 18021 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18022 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 18023 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 18024 | L4_MABX_B.SFunction1_o39 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 18025 | ); |
| 18026 | } |
| 18027 | |
| 18028 | if (modeSignal == 76) { |
| 18029 | /* ...... "tr9_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 18030 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18031 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 18032 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 18033 | L4_MABX_B.SFunction1_o40 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 18034 | ); |
| 18035 | } |
| 18036 | |
| 18037 | if (modeSignal == 6) { |
| 18038 | /* ...... "tr0_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18039 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 18040 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18041 | L4_MABX_B.SFunction1_o41 = 0.00392156862745098 * ( ((real_T) |
| 18042 | CAN_Sgn.UnsignedSgn) ); |
| 18043 | } |
| 18044 | |
| 18045 | if (modeSignal == 14) { |
| 18046 | /* ...... "tr1_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18047 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 18048 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18049 | L4_MABX_B.SFunction1_o42 = 0.00392156862745098 * ( ((real_T) |
| 18050 | CAN_Sgn.UnsignedSgn) ); |
| 18051 | } |
| 18052 | |
| 18053 | if (modeSignal == 22) { |
| 18054 | /* ...... "tr2_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18055 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 18056 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18057 | L4_MABX_B.SFunction1_o43 = 0.00392156862745098 * ( ((real_T) |
| 18058 | CAN_Sgn.UnsignedSgn) ); |
| 18059 | } |
| 18060 | |
| 18061 | if (modeSignal == 30) { |
| 18062 | /* ...... "tr3_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18063 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 18064 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18065 | L4_MABX_B.SFunction1_o44 = 0.00392156862745098 * ( ((real_T) |
| 18066 | CAN_Sgn.UnsignedSgn) ); |
| 18067 | } |
| 18068 | |
| 18069 | if (modeSignal == 38) { |
| 18070 | /* ...... "tr4_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18071 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 18072 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18073 | L4_MABX_B.SFunction1_o45 = 0.00392156862745098 * ( ((real_T) |
| 18074 | CAN_Sgn.UnsignedSgn) ); |
| 18075 | } |
| 18076 | |
| 18077 | if (modeSignal == 46) { |
| 18078 | /* ...... "tr5_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18079 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 18080 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18081 | L4_MABX_B.SFunction1_o46 = 0.00392156862745098 * ( ((real_T) |
| 18082 | CAN_Sgn.UnsignedSgn) ); |
| 18083 | } |
| 18084 | |
| 18085 | if (modeSignal == 54) { |
| 18086 | /* ...... "tr6_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18087 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 18088 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18089 | L4_MABX_B.SFunction1_o47 = 0.00392156862745098 * ( ((real_T) |
| 18090 | CAN_Sgn.UnsignedSgn) ); |
| 18091 | } |
| 18092 | |
| 18093 | if (modeSignal == 62) { |
| 18094 | /* ...... "tr7_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18095 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 18096 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18097 | L4_MABX_B.SFunction1_o48 = 0.00392156862745098 * ( ((real_T) |
| 18098 | CAN_Sgn.UnsignedSgn) ); |
| 18099 | } |
| 18100 | |
| 18101 | if (modeSignal == 70) { |
| 18102 | /* ...... "tr8_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18103 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 18104 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18105 | L4_MABX_B.SFunction1_o49 = 0.00392156862745098 * ( ((real_T) |
| 18106 | CAN_Sgn.UnsignedSgn) ); |
| 18107 | } |
| 18108 | |
| 18109 | if (modeSignal == 78) { |
| 18110 | /* ...... "tr9_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18111 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 18112 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18113 | L4_MABX_B.SFunction1_o50 = 0.00392156862745098 * ( ((real_T) |
| 18114 | CAN_Sgn.UnsignedSgn) ); |
| 18115 | } |
| 18116 | |
| 18117 | if (modeSignal == 4) { |
| 18118 | /* ...... "tr0_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 18119 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18120 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 18121 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 18122 | if (CAN_Sgn.SignedSgn >> 13) { |
| 18123 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 18124 | } |
| 18125 | |
| 18126 | L4_MABX_B.SFunction1_o51 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 18127 | } |
| 18128 | |
| 18129 | if (modeSignal == 5) { |
| 18130 | /* ...... "tr0_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18131 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18132 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18133 | L4_MABX_B.SFunction1_o52 = -8.8 + ( 0.05 * ( ((real_T) |
| 18134 | CAN_Sgn.UnsignedSgn) ) ); |
| 18135 | } |
| 18136 | |
| 18137 | if (modeSignal == 12) { |
| 18138 | /* ...... "tr1_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 18139 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18140 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 18141 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 18142 | if (CAN_Sgn.SignedSgn >> 13) { |
| 18143 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 18144 | } |
| 18145 | |
| 18146 | L4_MABX_B.SFunction1_o53 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 18147 | } |
| 18148 | |
| 18149 | if (modeSignal == 13) { |
| 18150 | /* ...... "tr1_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18151 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18152 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18153 | L4_MABX_B.SFunction1_o54 = -8.8 + ( 0.05 * ( ((real_T) |
| 18154 | CAN_Sgn.UnsignedSgn) ) ); |
| 18155 | } |
| 18156 | |
| 18157 | if (modeSignal == 20) { |
| 18158 | /* ...... "tr2_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 18159 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18160 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 18161 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 18162 | if (CAN_Sgn.SignedSgn >> 13) { |
| 18163 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 18164 | } |
| 18165 | |
| 18166 | L4_MABX_B.SFunction1_o55 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 18167 | } |
| 18168 | |
| 18169 | if (modeSignal == 21) { |
| 18170 | /* ...... "tr2_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18171 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18172 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18173 | L4_MABX_B.SFunction1_o56 = -8.8 + ( 0.05 * ( ((real_T) |
| 18174 | CAN_Sgn.UnsignedSgn) ) ); |
| 18175 | } |
| 18176 | |
| 18177 | if (modeSignal == 28) { |
| 18178 | /* ...... "tr3_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 18179 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18180 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 18181 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 18182 | if (CAN_Sgn.SignedSgn >> 13) { |
| 18183 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 18184 | } |
| 18185 | |
| 18186 | L4_MABX_B.SFunction1_o57 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 18187 | } |
| 18188 | |
| 18189 | if (modeSignal == 29) { |
| 18190 | /* ...... "tr3_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18191 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18192 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18193 | L4_MABX_B.SFunction1_o58 = -8.8 + ( 0.05 * ( ((real_T) |
| 18194 | CAN_Sgn.UnsignedSgn) ) ); |
| 18195 | } |
| 18196 | |
| 18197 | if (modeSignal == 36) { |
| 18198 | /* ...... "tr4_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 18199 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18200 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 18201 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 18202 | if (CAN_Sgn.SignedSgn >> 13) { |
| 18203 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 18204 | } |
| 18205 | |
| 18206 | L4_MABX_B.SFunction1_o59 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 18207 | } |
| 18208 | |
| 18209 | if (modeSignal == 37) { |
| 18210 | /* ...... "tr4_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18211 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18212 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18213 | L4_MABX_B.SFunction1_o60 = -8.8 + ( 0.05 * ( ((real_T) |
| 18214 | CAN_Sgn.UnsignedSgn) ) ); |
| 18215 | } |
| 18216 | |
| 18217 | if (modeSignal == 44) { |
| 18218 | /* ...... "tr5_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 18219 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18220 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 18221 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 18222 | if (CAN_Sgn.SignedSgn >> 13) { |
| 18223 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 18224 | } |
| 18225 | |
| 18226 | L4_MABX_B.SFunction1_o61 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 18227 | } |
| 18228 | |
| 18229 | if (modeSignal == 45) { |
| 18230 | /* ...... "tr5_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18231 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18232 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18233 | L4_MABX_B.SFunction1_o62 = -8.8 + ( 0.05 * ( ((real_T) |
| 18234 | CAN_Sgn.UnsignedSgn) ) ); |
| 18235 | } |
| 18236 | |
| 18237 | if (modeSignal == 52) { |
| 18238 | /* ...... "tr6_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 18239 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18240 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 18241 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 18242 | if (CAN_Sgn.SignedSgn >> 13) { |
| 18243 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 18244 | } |
| 18245 | |
| 18246 | L4_MABX_B.SFunction1_o63 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 18247 | } |
| 18248 | |
| 18249 | if (modeSignal == 53) { |
| 18250 | /* ...... "tr6_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18251 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18252 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18253 | L4_MABX_B.SFunction1_o64 = -8.8 + ( 0.05 * ( ((real_T) |
| 18254 | CAN_Sgn.UnsignedSgn) ) ); |
| 18255 | } |
| 18256 | |
| 18257 | if (modeSignal == 60) { |
| 18258 | /* ...... "tr7_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 18259 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18260 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 18261 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 18262 | if (CAN_Sgn.SignedSgn >> 13) { |
| 18263 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 18264 | } |
| 18265 | |
| 18266 | L4_MABX_B.SFunction1_o65 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 18267 | } |
| 18268 | |
| 18269 | if (modeSignal == 61) { |
| 18270 | /* ...... "tr7_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18271 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18272 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18273 | L4_MABX_B.SFunction1_o66 = -8.8 + ( 0.05 * ( ((real_T) |
| 18274 | CAN_Sgn.UnsignedSgn) ) ); |
| 18275 | } |
| 18276 | |
| 18277 | if (modeSignal == 68) { |
| 18278 | /* ...... "tr8_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 18279 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18280 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 18281 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 18282 | if (CAN_Sgn.SignedSgn >> 13) { |
| 18283 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 18284 | } |
| 18285 | |
| 18286 | L4_MABX_B.SFunction1_o67 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 18287 | } |
| 18288 | |
| 18289 | if (modeSignal == 69) { |
| 18290 | /* ...... "tr8_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18291 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18292 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18293 | L4_MABX_B.SFunction1_o68 = -8.8 + ( 0.05 * ( ((real_T) |
| 18294 | CAN_Sgn.UnsignedSgn) ) ); |
| 18295 | } |
| 18296 | |
| 18297 | if (modeSignal == 76) { |
| 18298 | /* ...... "tr9_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 18299 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18300 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 18301 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 18302 | if (CAN_Sgn.SignedSgn >> 13) { |
| 18303 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 18304 | } |
| 18305 | |
| 18306 | L4_MABX_B.SFunction1_o69 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 18307 | } |
| 18308 | |
| 18309 | if (modeSignal == 77) { |
| 18310 | /* ...... "tr9_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18311 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18312 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18313 | L4_MABX_B.SFunction1_o70 = -8.8 + ( 0.05 * ( ((real_T) |
| 18314 | CAN_Sgn.UnsignedSgn) ) ); |
| 18315 | } |
| 18316 | } |
| 18317 | } |
| 18318 | } else { |
| 18319 | /* set RX status to 0 because no new message has arrived */ |
| 18320 | L4_MABX_B.SFunction1_o72 = 0.0; |
| 18321 | } |
| 18322 | } |
| 18323 | } |
| 18324 | |
| 18325 | /* End of Constant: '<S434>/Constant' */ |
| 18326 | /* End of Outputs for SubSystem: '<S509>/Tracks' */ |
| 18327 | |
| 18328 | /* DataTypeConversion: '<S509>/Data Type Conversion10' */ |
| 18329 | L4_MABX_B.Bendix_RADAR_Tracks_RX_delta_ti = L4_MABX_B.SFunction1_o74; |
| 18330 | |
| 18331 | /* DataTypeConversion: '<S509>/Data Type Conversion8' */ |
| 18332 | L4_MABX_B.Bendix_RADAR_Tracks_RX_status = (L4_MABX_B.SFunction1_o72 != 0.0); |
| 18333 | |
| 18334 | /* DataTypeConversion: '<S509>/Data Type Conversion9' */ |
| 18335 | L4_MABX_B.Bendix_RADAR_Tracks_RX_time = L4_MABX_B.SFunction1_o73; |
| 18336 | |
| 18337 | /* DataTypeConversion: '<S511>/Data Type Conversion10' */ |
| 18338 | L4_MABX_B.RX_delta_time_i = L4_MABX_B.SFunction1_o23_o; |
| 18339 | |
| 18340 | /* DataTypeConversion: '<S511>/Data Type Conversion8' */ |
| 18341 | L4_MABX_B.RX_status_ln = (L4_MABX_B.SFunction1_o21_j != 0.0); |
| 18342 | |
| 18343 | /* DataTypeConversion: '<S511>/Data Type Conversion9' */ |
| 18344 | L4_MABX_B.RX_time_nv = L4_MABX_B.SFunction1_o22_oy; |
| 18345 | |
| 18346 | /* DataTypeConversion: '<S513>/Data Type Conversion10' */ |
| 18347 | L4_MABX_B.RX_delta_time_n = L4_MABX_B.SFunction1_o23_i; |
| 18348 | |
| 18349 | /* DataTypeConversion: '<S513>/Data Type Conversion8' */ |
| 18350 | L4_MABX_B.RX_status_ed = (L4_MABX_B.SFunction1_o21_e != 0.0); |
| 18351 | |
| 18352 | /* DataTypeConversion: '<S513>/Data Type Conversion9' */ |
| 18353 | L4_MABX_B.RX_time_j = L4_MABX_B.SFunction1_o22_ih; |
| 18354 | |
| 18355 | /* Switch: '<S515>/Switch' */ |
| 18356 | if (L4_MABX_B.RX_status_e) { |
| 18357 | L4_MABX_B.RX_status_aq = L4_MABX_B.RX_status_e; |
| 18358 | } else { |
| 18359 | /* DataTypeConversion: '<S515>/Data Type Conversion1' */ |
| 18360 | L4_MABX_B.RX_status_jm = (L4_MABX_B.SFunction1_o5_f1p != 0.0); |
| 18361 | L4_MABX_B.RX_status_aq = L4_MABX_B.RX_status_jm; |
| 18362 | } |
| 18363 | |
| 18364 | if (L4_MABX_B.RX_status_e) { |
| 18365 | /* DataTypeConversion: '<S515>/Data Type Conversion9' */ |
| 18366 | L4_MABX_B.RX_time_aa = L4_MABX_B.SFunction1_o6_ez; |
| 18367 | L4_MABX_B.RX_time_a = L4_MABX_B.RX_time_aa; |
| 18368 | |
| 18369 | /* DataTypeConversion: '<S515>/Data Type Conversion10' */ |
| 18370 | L4_MABX_B.RX_delta_time_hb = L4_MABX_B.SFunction1_o7_j; |
| 18371 | L4_MABX_B.RX_delta_time_cn = L4_MABX_B.RX_delta_time_hb; |
| 18372 | } else { |
| 18373 | /* DataTypeConversion: '<S515>/Data Type Conversion2' */ |
| 18374 | L4_MABX_B.RX_time_kx = L4_MABX_B.SFunction1_o6_f; |
| 18375 | L4_MABX_B.RX_time_a = L4_MABX_B.RX_time_kx; |
| 18376 | |
| 18377 | /* DataTypeConversion: '<S515>/Data Type Conversion3' */ |
| 18378 | L4_MABX_B.RX_delta_time_ga = L4_MABX_B.SFunction1_o7_bu; |
| 18379 | L4_MABX_B.RX_delta_time_cn = L4_MABX_B.RX_delta_time_ga; |
| 18380 | } |
| 18381 | |
| 18382 | /* DataTypeConversion: '<S518>/Data Type Conversion10' */ |
| 18383 | L4_MABX_B.RX_delta_time_kz = L4_MABX_B.SFunction1_o4_ha; |
| 18384 | |
| 18385 | /* DataTypeConversion: '<S518>/Data Type Conversion8' */ |
| 18386 | L4_MABX_B.RX_status_d = (L4_MABX_B.SFunction1_o2_bq != 0.0); |
| 18387 | |
| 18388 | /* DataTypeConversion: '<S518>/Data Type Conversion9' */ |
| 18389 | L4_MABX_B.RX_time_no = L4_MABX_B.SFunction1_o3_dd; |
| 18390 | |
| 18391 | /* Outputs for Enabled SubSystem: '<S520>/EBC1_0B' incorporates: |
| 18392 | * EnablePort: '<S521>/Enable' |
| 18393 | */ |
| 18394 | /* Constant: '<S439>/Constant1' */ |
| 18395 | if (L4_MABX_P.Constant1_Value_nx) { |
| 18396 | /* S-Function (rti_commonblock): '<S521>/S-Function1' */ |
| 18397 | /* This comment workarounds a code generation problem */ |
| 18398 | |
| 18399 | /* dSPACE RTICAN RX Message Block: "EBC1_0B" Id:418382091 */ |
| 18400 | { |
| 18401 | UInt32 *CAN_Msg; |
| 18402 | static dsfloat time_old = 0.0; |
| 18403 | |
| 18404 | /* Read status and timestamp info (previous message) */ |
| 18405 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0010B].timestamp != |
| 18406 | time_old) { |
| 18407 | /* ... save timestamp info for the calculation of the RX status |
| 18408 | during the consecutive sample hit*/ |
| 18409 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0010B]. |
| 18410 | timestamp; |
| 18411 | |
| 18412 | /* ... set the processed flag to one */ |
| 18413 | L4_MABX_B.SFunction1_o23_n = 1.0; |
| 18414 | L4_MABX_B.SFunction1_o24_o = (real_T) |
| 18415 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0010B].timestamp; |
| 18416 | L4_MABX_B.SFunction1_o25_m = (real_T) |
| 18417 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0010B].deltatime; |
| 18418 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0010B].data; |
| 18419 | |
| 18420 | /* Decode CAN message */ |
| 18421 | { |
| 18422 | { |
| 18423 | rtican_Signal_t CAN_Sgn; |
| 18424 | |
| 18425 | /* ...... "ASREngCtrlActive" (0|2, standard signal, unsigned int, little endian) */ |
| 18426 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18427 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18428 | L4_MABX_B.SFunction1_o1_bq = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18429 | |
| 18430 | /* ...... "ASRBrakeCtrlActive" (2|2, standard signal, unsigned int, little endian) */ |
| 18431 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18432 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18433 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18434 | L4_MABX_B.SFunction1_o2_pl3 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18435 | |
| 18436 | /* ...... "AntiLockBrakingActive" (4|2, standard signal, unsigned int, little endian) */ |
| 18437 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18438 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 18439 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18440 | L4_MABX_B.SFunction1_o3_bzd = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18441 | |
| 18442 | /* ...... "EBSBrakeSwitch" (6|2, standard signal, unsigned int, little endian) */ |
| 18443 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18444 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 18445 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18446 | L4_MABX_B.SFunction1_o4_cj = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18447 | |
| 18448 | /* ...... "BrakePedalPos" (8|8, standard signal, unsigned int, little endian) */ |
| 18449 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 18450 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18451 | L4_MABX_B.SFunction1_o5_a = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 18452 | |
| 18453 | /* ...... "ABSOffroadSwitch" (16|2, standard signal, unsigned int, little endian) */ |
| 18454 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 18455 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18456 | L4_MABX_B.SFunction1_o6_nt = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18457 | |
| 18458 | /* ...... "ASROffroadSwitch" (18|2, standard signal, unsigned int, little endian) */ |
| 18459 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 18460 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18461 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18462 | L4_MABX_B.SFunction1_o7_lm = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18463 | |
| 18464 | /* ...... "ASRHillHolderSwitch" (20|2, standard signal, unsigned int, little endian) */ |
| 18465 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 18466 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 18467 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18468 | L4_MABX_B.SFunction1_o8_n5 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18469 | |
| 18470 | /* ...... "TractionCtrlOverrideSwitch" (22|2, standard signal, unsigned int, little endian) */ |
| 18471 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 18472 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 18473 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18474 | L4_MABX_B.SFunction1_o9_dw = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18475 | |
| 18476 | /* ...... "AccelInterlockSwitch" (24|2, standard signal, unsigned int, little endian) */ |
| 18477 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18478 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18479 | L4_MABX_B.SFunction1_o10_by = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18480 | |
| 18481 | /* ...... "EngDerateSwitch" (26|2, standard signal, unsigned int, little endian) */ |
| 18482 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18483 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18484 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18485 | L4_MABX_B.SFunction1_o11_m = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18486 | |
| 18487 | /* ...... "EngAuxShutdownSwitch" (28|2, standard signal, unsigned int, little endian) */ |
| 18488 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18489 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 18490 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18491 | L4_MABX_B.SFunction1_o12_l = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18492 | |
| 18493 | /* ...... "RemoteAccelEnableSwitch" (30|2, standard signal, unsigned int, little endian) */ |
| 18494 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18495 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 18496 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18497 | L4_MABX_B.SFunction1_o13_d = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18498 | |
| 18499 | /* ...... "EngRetarderSelection" (32|8, standard signal, unsigned int, little endian) */ |
| 18500 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 18501 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18502 | L4_MABX_B.SFunction1_o14_n = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 18503 | |
| 18504 | /* ...... "ABSFullyOperational" (40|2, standard signal, unsigned int, little endian) */ |
| 18505 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18506 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18507 | L4_MABX_B.SFunction1_o15_a0 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18508 | |
| 18509 | /* ...... "EBSRedWarningSignal" (42|2, standard signal, unsigned int, little endian) */ |
| 18510 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18511 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18512 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18513 | L4_MABX_B.SFunction1_o16_k = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18514 | |
| 18515 | /* ...... "ABS_EBSAmberWarningSignal" (44|2, standard signal, unsigned int, little endian) */ |
| 18516 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18517 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 18518 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18519 | L4_MABX_B.SFunction1_o17_j = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18520 | |
| 18521 | /* ...... "ATC_ASRInformationSignal" (46|2, standard signal, unsigned int, little endian) */ |
| 18522 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18523 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 18524 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18525 | L4_MABX_B.SFunction1_o18_d = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18526 | |
| 18527 | /* ...... "SrcAddrssOfCtrllngDvcFrBrkCntrl" (48|8, standard signal, unsigned int, little endian) */ |
| 18528 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 18529 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18530 | L4_MABX_B.SFunction1_o19_k = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18531 | |
| 18532 | /* ...... "HaltBrakeSwitch" (58|2, standard signal, unsigned int, little endian) */ |
| 18533 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 18534 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18535 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18536 | L4_MABX_B.SFunction1_o20_h = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18537 | |
| 18538 | /* ...... "TrailerABSStatus" (60|2, standard signal, unsigned int, little endian) */ |
| 18539 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 18540 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 18541 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18542 | L4_MABX_B.SFunction1_o21_l = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18543 | |
| 18544 | /* ...... "TrctrMntdTrilerABSWarningSignal" (62|2, standard signal, unsigned int, little endian) */ |
| 18545 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 18546 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 18547 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18548 | L4_MABX_B.SFunction1_o22_i = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18549 | } |
| 18550 | } |
| 18551 | } else { |
| 18552 | /* set RX status to 0 because no new message has arrived */ |
| 18553 | L4_MABX_B.SFunction1_o23_n = 0.0; |
| 18554 | } |
| 18555 | } |
| 18556 | } |
| 18557 | |
| 18558 | /* End of Constant: '<S439>/Constant1' */ |
| 18559 | /* End of Outputs for SubSystem: '<S520>/EBC1_0B' */ |
| 18560 | |
| 18561 | /* DataTypeConversion: '<S520>/Data Type Conversion10' */ |
| 18562 | L4_MABX_B.RX_delta_time_m = L4_MABX_B.SFunction1_o25_m; |
| 18563 | |
| 18564 | /* DataTypeConversion: '<S520>/Data Type Conversion8' */ |
| 18565 | L4_MABX_B.RX_status_b = (L4_MABX_B.SFunction1_o23_n != 0.0); |
| 18566 | |
| 18567 | /* DataTypeConversion: '<S520>/Data Type Conversion9' */ |
| 18568 | L4_MABX_B.RX_time_ih = L4_MABX_B.SFunction1_o24_o; |
| 18569 | |
| 18570 | /* DataTypeConversion: '<S522>/Data Type Conversion10' */ |
| 18571 | L4_MABX_B.RX_delta_time_nf = L4_MABX_B.SFunction1_o25_p; |
| 18572 | |
| 18573 | /* DataTypeConversion: '<S522>/Data Type Conversion8' */ |
| 18574 | L4_MABX_B.RX_status_g2 = (L4_MABX_B.SFunction1_o23_b != 0.0); |
| 18575 | |
| 18576 | /* DataTypeConversion: '<S522>/Data Type Conversion9' */ |
| 18577 | L4_MABX_B.RX_time_an = L4_MABX_B.SFunction1_o24_l; |
| 18578 | |
| 18579 | /* DataTypeConversion: '<S524>/Data Type Conversion10' */ |
| 18580 | L4_MABX_B.RX_delta_time_ja = L4_MABX_B.SFunction1_o10_pk; |
| 18581 | |
| 18582 | /* DataTypeConversion: '<S524>/Data Type Conversion8' */ |
| 18583 | L4_MABX_B.RX_status_n = (L4_MABX_B.SFunction1_o8_bo != 0.0); |
| 18584 | |
| 18585 | /* DataTypeConversion: '<S524>/Data Type Conversion9' */ |
| 18586 | L4_MABX_B.RX_time_c = L4_MABX_B.SFunction1_o9_a; |
| 18587 | |
| 18588 | /* DataTypeConversion: '<S571>/Data Type Conversion10' */ |
| 18589 | L4_MABX_B.RX_delta_time_ne = L4_MABX_B.SFunction1_o11_b; |
| 18590 | |
| 18591 | /* DataTypeConversion: '<S571>/Data Type Conversion8' */ |
| 18592 | L4_MABX_B.RX_status_h5 = (L4_MABX_B.SFunction1_o9_gn != 0.0); |
| 18593 | |
| 18594 | /* DataTypeConversion: '<S571>/Data Type Conversion9' */ |
| 18595 | L4_MABX_B.RX_time_f = L4_MABX_B.SFunction1_o10_b; |
| 18596 | |
| 18597 | /* Outputs for Enabled SubSystem: '<S573>/EEC2_001' incorporates: |
| 18598 | * EnablePort: '<S574>/Enable' |
| 18599 | */ |
| 18600 | /* Constant: '<S444>/Enable_RX_EEC2_00' */ |
| 18601 | if (L4_MABX_P.Enable_RX_EEC2_00_Value) { |
| 18602 | /* S-Function (rti_commonblock): '<S574>/S-Function1' */ |
| 18603 | /* This comment workarounds a code generation problem */ |
| 18604 | |
| 18605 | /* dSPACE RTICAN RX Message Block: "EEC2_00" Id:217056000 */ |
| 18606 | { |
| 18607 | UInt32 *CAN_Msg; |
| 18608 | static dsfloat time_old = 0.0; |
| 18609 | |
| 18610 | /* Read status and timestamp info (previous message) */ |
| 18611 | if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0xCF00300].timestamp != |
| 18612 | time_old) { |
| 18613 | /* ... save timestamp info for the calculation of the RX status |
| 18614 | during the consecutive sample hit*/ |
| 18615 | time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0xCF00300]. |
| 18616 | timestamp; |
| 18617 | |
| 18618 | /* ... set the processed flag to one */ |
| 18619 | L4_MABX_B.SFunction1_o15_d = 1.0; |
| 18620 | L4_MABX_B.SFunction1_o16_e = (real_T) |
| 18621 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0xCF00300].timestamp; |
| 18622 | L4_MABX_B.SFunction1_o17_l = (real_T) |
| 18623 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0xCF00300].deltatime; |
| 18624 | CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0xCF00300].data; |
| 18625 | |
| 18626 | /* Decode CAN message */ |
| 18627 | { |
| 18628 | { |
| 18629 | rtican_Signal_t CAN_Sgn; |
| 18630 | |
| 18631 | /* ...... "SPN558_AccelPed1LowIdlSwitch" (0|2, standard signal, unsigned int, little endian) */ |
| 18632 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18633 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18634 | L4_MABX_B.SFunction1_o1_a0 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18635 | |
| 18636 | /* ...... "SPN559_AccelPedKickdownSw" (2|2, standard signal, unsigned int, little endian) */ |
| 18637 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18638 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18639 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18640 | L4_MABX_B.SFunction1_o2_m4 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18641 | |
| 18642 | /* ...... "SPN1437_RoadSpeedLimitStatus" (4|2, standard signal, unsigned int, little endian) */ |
| 18643 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18644 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 18645 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18646 | L4_MABX_B.SFunction1_o3_k = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18647 | |
| 18648 | /* ...... "SPN2970_AccelPed2LowIdlSwitch" (6|2, standard signal, unsigned int, little endian) */ |
| 18649 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18650 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 18651 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18652 | L4_MABX_B.SFunction1_o4_nu = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18653 | |
| 18654 | /* ...... "SPN91_AccelPedPos1" (8|8, standard signal, unsigned int, little endian) */ |
| 18655 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 18656 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18657 | L4_MABX_B.SFunction1_o5_e0 = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 18658 | |
| 18659 | /* ...... "SPN92_EngPercLoadAtCurrSpd" (16|8, standard signal, unsigned int, little endian) */ |
| 18660 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 18661 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18662 | L4_MABX_B.SFunction1_o6_j = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18663 | |
| 18664 | /* ...... "SPN974_RemAccelPedalPosition" (24|8, standard signal, unsigned int, little endian) */ |
| 18665 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18666 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18667 | L4_MABX_B.SFunction1_o7_b = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 18668 | |
| 18669 | /* ...... "SPN29_AccelPedPos2" (32|8, standard signal, unsigned int, little endian) */ |
| 18670 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 18671 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18672 | L4_MABX_B.SFunction1_o8_py = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 18673 | |
| 18674 | /* ...... "SPN2979_VehAccelRateLimStatus" (40|2, standard signal, unsigned int, little endian) */ |
| 18675 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18676 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18677 | L4_MABX_B.SFunction1_o9_iy = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18678 | |
| 18679 | /* ...... "SPN5021_MomEngMaxPwrEnFdbk" (42|2, standard signal, unsigned int, little endian) */ |
| 18680 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18681 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18682 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18683 | L4_MABX_B.SFunction1_o10_m = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18684 | |
| 18685 | /* ...... "SPN5399_DPFThermMgmtActive" (44|2, standard signal, unsigned int, little endian) */ |
| 18686 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18687 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 18688 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18689 | L4_MABX_B.SFunction1_o11_c = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18690 | |
| 18691 | /* ...... "SPN5400_SCRThermMgmtActive" (46|2, standard signal, unsigned int, little endian) */ |
| 18692 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18693 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 18694 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18695 | L4_MABX_B.SFunction1_o12_i = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18696 | |
| 18697 | /* ...... "SPN3357_ActMaxAvailEngPercTrq" (48|8, standard signal, unsigned int, little endian) */ |
| 18698 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 18699 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18700 | L4_MABX_B.SFunction1_o13_gy = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 18701 | ); |
| 18702 | |
| 18703 | /* ...... "SPN5398_EstPumpingPercentTorque" (56|8, standard signal, unsigned int, little endian) */ |
| 18704 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 18705 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18706 | L4_MABX_B.SFunction1_o14_g = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 18707 | ); |
| 18708 | } |
| 18709 | } |
| 18710 | } else { |
| 18711 | /* set RX status to 0 because no new message has arrived */ |
| 18712 | L4_MABX_B.SFunction1_o15_d = 0.0; |
| 18713 | } |
| 18714 | } |
| 18715 | } |
| 18716 | |
| 18717 | /* End of Constant: '<S444>/Enable_RX_EEC2_00' */ |
| 18718 | /* End of Outputs for SubSystem: '<S573>/EEC2_001' */ |
| 18719 | |
| 18720 | /* DataTypeConversion: '<S573>/Data Type Conversion10' */ |
| 18721 | L4_MABX_B.RX_delta_time_b = L4_MABX_B.SFunction1_o17_l; |
| 18722 | |
| 18723 | /* DataTypeConversion: '<S573>/Data Type Conversion8' */ |
| 18724 | L4_MABX_B.RX_status_nu = (L4_MABX_B.SFunction1_o15_d != 0.0); |
| 18725 | |
| 18726 | /* DataTypeConversion: '<S573>/Data Type Conversion9' */ |
| 18727 | L4_MABX_B.RX_time_d = L4_MABX_B.SFunction1_o16_e; |
| 18728 | |
| 18729 | /* DataTypeConversion: '<S575>/Data Type Conversion10' */ |
| 18730 | L4_MABX_B.RX_delta_time_g = L4_MABX_B.SFunction1_o5_jl; |
| 18731 | |
| 18732 | /* DataTypeConversion: '<S575>/Data Type Conversion8' */ |
| 18733 | L4_MABX_B.RX_status_j = (L4_MABX_B.SFunction1_o3_fy != 0.0); |
| 18734 | |
| 18735 | /* DataTypeConversion: '<S575>/Data Type Conversion9' */ |
| 18736 | L4_MABX_B.RX_time_n0 = L4_MABX_B.SFunction1_o4_lo; |
| 18737 | |
| 18738 | /* DataTypeConversion: '<S577>/Data Type Conversion10' */ |
| 18739 | L4_MABX_B.RX_delta_time_kx = L4_MABX_B.SFunction1_o6_o; |
| 18740 | |
| 18741 | /* DataTypeConversion: '<S577>/Data Type Conversion8' */ |
| 18742 | L4_MABX_B.RX_status_c4 = (L4_MABX_B.SFunction1_o4_ly != 0.0); |
| 18743 | |
| 18744 | /* DataTypeConversion: '<S577>/Data Type Conversion9' */ |
| 18745 | L4_MABX_B.RX_time_o = L4_MABX_B.SFunction1_o5_e3; |
| 18746 | |
| 18747 | /* Switch: '<S579>/Switch' */ |
| 18748 | if (L4_MABX_B.RX_status_h) { |
| 18749 | L4_MABX_B.SID_p = L4_MABX_B.SFunction1_o1_hs; |
| 18750 | L4_MABX_B.SetMode = L4_MABX_B.SFunction1_o2_d0; |
| 18751 | L4_MABX_B.OpMode = L4_MABX_B.SFunction1_o3_o4; |
| 18752 | L4_MABX_B.VDOP = L4_MABX_B.SFunction1_o5_nf; |
| 18753 | L4_MABX_B.TDOP = L4_MABX_B.SFunction1_o6_g4y; |
| 18754 | L4_MABX_B.RX_status_kh = L4_MABX_B.RX_status_h; |
| 18755 | } else { |
| 18756 | L4_MABX_B.SID_p = L4_MABX_B.SFunction1_o1_lx; |
| 18757 | L4_MABX_B.SetMode = L4_MABX_B.SFunction1_o2_ad5; |
| 18758 | L4_MABX_B.OpMode = L4_MABX_B.SFunction1_o3_g5; |
| 18759 | L4_MABX_B.VDOP = L4_MABX_B.SFunction1_o5_lw; |
| 18760 | L4_MABX_B.TDOP = L4_MABX_B.SFunction1_o6_nk; |
| 18761 | |
| 18762 | /* DataTypeConversion: '<S579>/Data Type Conversion3' */ |
| 18763 | L4_MABX_B.RX_status_gi = (L4_MABX_B.SFunction1_o7_ev != 0.0); |
| 18764 | L4_MABX_B.RX_status_kh = L4_MABX_B.RX_status_gi; |
| 18765 | } |
| 18766 | |
| 18767 | if (L4_MABX_B.RX_status_h) { |
| 18768 | /* DataTypeConversion: '<S579>/Data Type Conversion9' */ |
| 18769 | L4_MABX_B.RX_time_ml = L4_MABX_B.SFunction1_o8_es; |
| 18770 | L4_MABX_B.RX_time_le = L4_MABX_B.RX_time_ml; |
| 18771 | |
| 18772 | /* DataTypeConversion: '<S579>/Data Type Conversion10' */ |
| 18773 | L4_MABX_B.RX_delta_time_fl = L4_MABX_B.SFunction1_o9_gd; |
| 18774 | L4_MABX_B.RX_delta_time_ms = L4_MABX_B.RX_delta_time_fl; |
| 18775 | } else { |
| 18776 | /* DataTypeConversion: '<S579>/Data Type Conversion2' */ |
| 18777 | L4_MABX_B.RX_time_d1 = L4_MABX_B.SFunction1_o8_lx; |
| 18778 | L4_MABX_B.RX_time_le = L4_MABX_B.RX_time_d1; |
| 18779 | |
| 18780 | /* DataTypeConversion: '<S579>/Data Type Conversion1' */ |
| 18781 | L4_MABX_B.RX_delta_time_iw = L4_MABX_B.SFunction1_o9_d; |
| 18782 | L4_MABX_B.RX_delta_time_ms = L4_MABX_B.RX_delta_time_iw; |
| 18783 | } |
| 18784 | |
| 18785 | /* DataTypeConversion: '<S582>/Data Type Conversion10' */ |
| 18786 | L4_MABX_B.RX_delta_time_jj = L4_MABX_B.SFunction1_o7_cp; |
| 18787 | |
| 18788 | /* DataTypeConversion: '<S582>/Data Type Conversion8' */ |
| 18789 | L4_MABX_B.RX_status_f = (L4_MABX_B.SFunction1_o5_ij != 0.0); |
| 18790 | |
| 18791 | /* DataTypeConversion: '<S582>/Data Type Conversion9' */ |
| 18792 | L4_MABX_B.RX_time_h = L4_MABX_B.SFunction1_o6_kk; |
| 18793 | |
| 18794 | /* Switch: '<S449>/Switch' */ |
| 18795 | if (L4_MABX_B.Operator_nc) { |
| 18796 | ReAX_EchoedSteerWheelPos = L4_MABX_B.SFunction1_o2_jnu; |
| 18797 | |
| 18798 | /* DataTypeConversion: '<S584>/Data Type Conversion8' */ |
| 18799 | L4_MABX_B.RX_status_og = (L4_MABX_B.SFunction1_o3_pv != 0.0); |
| 18800 | L4_MABX_B.RX_status_n4 = L4_MABX_B.RX_status_og; |
| 18801 | |
| 18802 | /* DataTypeConversion: '<S584>/Data Type Conversion9' */ |
| 18803 | L4_MABX_B.RX_time_ob = L4_MABX_B.SFunction1_o4_c; |
| 18804 | L4_MABX_B.RX_time_l4 = L4_MABX_B.RX_time_ob; |
| 18805 | |
| 18806 | /* DataTypeConversion: '<S584>/Data Type Conversion10' */ |
| 18807 | L4_MABX_B.RX_delta_time_a5 = L4_MABX_B.SFunction1_o5_ni; |
| 18808 | L4_MABX_B.RX_delta_time_n5 = L4_MABX_B.RX_delta_time_a5; |
| 18809 | } else { |
| 18810 | ReAX_EchoedSteerWheelPos = L4_MABX_B.SFunction1_o2_g5; |
| 18811 | |
| 18812 | /* DataTypeConversion: '<S585>/Data Type Conversion8' */ |
| 18813 | L4_MABX_B.RX_status_kul = (L4_MABX_B.SFunction1_o3_l1 != 0.0); |
| 18814 | L4_MABX_B.RX_status_n4 = L4_MABX_B.RX_status_kul; |
| 18815 | |
| 18816 | /* DataTypeConversion: '<S585>/Data Type Conversion9' */ |
| 18817 | L4_MABX_B.RX_time_ks = L4_MABX_B.SFunction1_o4_k1; |
| 18818 | L4_MABX_B.RX_time_l4 = L4_MABX_B.RX_time_ks; |
| 18819 | |
| 18820 | /* DataTypeConversion: '<S585>/Data Type Conversion10' */ |
| 18821 | L4_MABX_B.RX_delta_time_iq = L4_MABX_B.SFunction1_o5_j; |
| 18822 | L4_MABX_B.RX_delta_time_n5 = L4_MABX_B.RX_delta_time_iq; |
| 18823 | } |
| 18824 | |
| 18825 | /* RelationalOperator: '<S621>/Operator' incorporates: |
| 18826 | * Constant: '<S452>/Constant' |
| 18827 | * Constant: '<S617>/Constant' |
| 18828 | */ |
| 18829 | L4_MABX_B.Operator_k5 = (CANR_PROPB_XPR_1_50_CHANNEL_APV == |
| 18830 | L4_MABX_P.Constant_Value_p0); |
| 18831 | |
| 18832 | /* Outputs for Enabled SubSystem: '<S614>/CAN_TYPE1_RX_M1_C1' incorporates: |
| 18833 | * EnablePort: '<S618>/Enable' |
| 18834 | */ |
| 18835 | if (L4_MABX_B.Operator_k5) { |
| 18836 | /* S-Function (rti_commonblock): '<S618>/S-Function1' */ |
| 18837 | /* This comment workarounds a code generation problem */ |
| 18838 | |
| 18839 | /* dSPACE RTICAN RX Message Block: "PropB_XPR_1" Id:419387472 */ |
| 18840 | { |
| 18841 | UInt32 *CAN_Msg; |
| 18842 | static dsfloat time_old = 0.0; |
| 18843 | |
| 18844 | /* Read status and timestamp info (previous message) */ |
| 18845 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FF5850].timestamp != |
| 18846 | time_old) { |
| 18847 | /* ... save timestamp info for the calculation of the RX status |
| 18848 | during the consecutive sample hit*/ |
| 18849 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FF5850]. |
| 18850 | timestamp; |
| 18851 | |
| 18852 | /* ... set the processed flag to one */ |
| 18853 | L4_MABX_B.SFunction1_o3_jj = 1.0; |
| 18854 | L4_MABX_B.SFunction1_o4_i = (real_T) |
| 18855 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FF5850].timestamp; |
| 18856 | L4_MABX_B.SFunction1_o5_k = (real_T) |
| 18857 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FF5850].deltatime; |
| 18858 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FF5850].data; |
| 18859 | |
| 18860 | /* Decode CAN message */ |
| 18861 | { |
| 18862 | { |
| 18863 | rtican_Signal_t CAN_Sgn; |
| 18864 | |
| 18865 | /* ...... "EPBPCMInhibitStatusFeedback" (0|2, standard signal, unsigned int, little endian) */ |
| 18866 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18867 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18868 | L4_MABX_B.SFunction1_o1_nn = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18869 | |
| 18870 | /* ...... "EPBPCMManualStatusFeedback" (2|2, standard signal, unsigned int, little endian) */ |
| 18871 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18872 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18873 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18874 | L4_MABX_B.SFunction1_o2_pn = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18875 | } |
| 18876 | } |
| 18877 | } else { |
| 18878 | /* set RX status to 0 because no new message has arrived */ |
| 18879 | L4_MABX_B.SFunction1_o3_jj = 0.0; |
| 18880 | } |
| 18881 | } |
| 18882 | } |
| 18883 | |
| 18884 | /* End of Outputs for SubSystem: '<S614>/CAN_TYPE1_RX_M1_C1' */ |
| 18885 | |
| 18886 | /* RelationalOperator: '<S622>/Operator' incorporates: |
| 18887 | * Constant: '<S452>/Constant' |
| 18888 | * Constant: '<S617>/Constant1' |
| 18889 | */ |
| 18890 | L4_MABX_B.Operator_j1 = (CANR_PROPB_XPR_1_50_CHANNEL_APV == |
| 18891 | L4_MABX_P.Constant1_Value_j2); |
| 18892 | |
| 18893 | /* Outputs for Enabled SubSystem: '<S615>/CAN_TYPE1_RX_M1_C2' incorporates: |
| 18894 | * EnablePort: '<S619>/Enable' |
| 18895 | */ |
| 18896 | if (L4_MABX_B.Operator_j1) { |
| 18897 | /* S-Function (rti_commonblock): '<S619>/S-Function1' */ |
| 18898 | /* This comment workarounds a code generation problem */ |
| 18899 | |
| 18900 | /* dSPACE RTICAN RX Message Block: "PropB_XPR_1" Id:419387472 */ |
| 18901 | { |
| 18902 | UInt32 *CAN_Msg; |
| 18903 | static dsfloat time_old = 0.0; |
| 18904 | |
| 18905 | /* Read status and timestamp info (previous message) */ |
| 18906 | if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FF5850].timestamp != |
| 18907 | time_old) { |
| 18908 | /* ... save timestamp info for the calculation of the RX status |
| 18909 | during the consecutive sample hit*/ |
| 18910 | time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FF5850]. |
| 18911 | timestamp; |
| 18912 | |
| 18913 | /* ... set the processed flag to one */ |
| 18914 | L4_MABX_B.SFunction1_o3_gz = 1.0; |
| 18915 | L4_MABX_B.SFunction1_o4_hf3 = (real_T) |
| 18916 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FF5850].timestamp; |
| 18917 | L4_MABX_B.SFunction1_o5_p5 = (real_T) |
| 18918 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FF5850].deltatime; |
| 18919 | CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FF5850].data; |
| 18920 | |
| 18921 | /* Decode CAN message */ |
| 18922 | { |
| 18923 | { |
| 18924 | rtican_Signal_t CAN_Sgn; |
| 18925 | |
| 18926 | /* ...... "EPBPCMInhibitStatusFeedback" (0|2, standard signal, unsigned int, little endian) */ |
| 18927 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18928 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18929 | L4_MABX_B.SFunction1_o1_lae = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18930 | |
| 18931 | /* ...... "EPBPCMManualStatusFeedback" (2|2, standard signal, unsigned int, little endian) */ |
| 18932 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18933 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18934 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18935 | L4_MABX_B.SFunction1_o2_bh = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18936 | } |
| 18937 | } |
| 18938 | } else { |
| 18939 | /* set RX status to 0 because no new message has arrived */ |
| 18940 | L4_MABX_B.SFunction1_o3_gz = 0.0; |
| 18941 | } |
| 18942 | } |
| 18943 | } |
| 18944 | |
| 18945 | /* End of Outputs for SubSystem: '<S615>/CAN_TYPE1_RX_M1_C2' */ |
| 18946 | |
| 18947 | /* RelationalOperator: '<S623>/Operator' incorporates: |
| 18948 | * Constant: '<S452>/Constant' |
| 18949 | * Constant: '<S617>/Constant2' |
| 18950 | */ |
| 18951 | L4_MABX_B.Operator_g3 = (CANR_PROPB_XPR_1_50_CHANNEL_APV == |
| 18952 | L4_MABX_P.Constant2_Value_j); |
| 18953 | |
| 18954 | /* Outputs for Enabled SubSystem: '<S616>/CAN_TYPE1_RX_M2_C1' incorporates: |
| 18955 | * EnablePort: '<S620>/Enable' |
| 18956 | */ |
| 18957 | if (L4_MABX_B.Operator_g3) { |
| 18958 | /* S-Function (rti_commonblock): '<S620>/S-Function1' */ |
| 18959 | /* This comment workarounds a code generation problem */ |
| 18960 | |
| 18961 | /* dSPACE RTICAN RX Message Block: "PropB_XPR_1" Id:419387472 */ |
| 18962 | { |
| 18963 | UInt32 *CAN_Msg; |
| 18964 | static dsfloat time_old = 0.0; |
| 18965 | |
| 18966 | /* Read status and timestamp info (previous message) */ |
| 18967 | if (can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF5850].timestamp != |
| 18968 | time_old) { |
| 18969 | /* ... save timestamp info for the calculation of the RX status |
| 18970 | during the consecutive sample hit*/ |
| 18971 | time_old = can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF5850]. |
| 18972 | timestamp; |
| 18973 | |
| 18974 | /* ... set the processed flag to one */ |
| 18975 | L4_MABX_B.SFunction1_o3_p = 1.0; |
| 18976 | L4_MABX_B.SFunction1_o4_au = (real_T) |
| 18977 | can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF5850].timestamp; |
| 18978 | L4_MABX_B.SFunction1_o5_ne = (real_T) |
| 18979 | can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF5850].deltatime; |
| 18980 | CAN_Msg = can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF5850].data; |
| 18981 | |
| 18982 | /* Decode CAN message */ |
| 18983 | { |
| 18984 | { |
| 18985 | rtican_Signal_t CAN_Sgn; |
| 18986 | |
| 18987 | /* ...... "EPBPCMInhibitStatusFeedback" (0|2, standard signal, unsigned int, little endian) */ |
| 18988 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18989 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18990 | L4_MABX_B.SFunction1_o1_n0 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18991 | |
| 18992 | /* ...... "EPBPCMManualStatusFeedback" (2|2, standard signal, unsigned int, little endian) */ |
| 18993 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18994 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18995 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18996 | L4_MABX_B.SFunction1_o2_fk = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18997 | } |
| 18998 | } |
| 18999 | } else { |
| 19000 | /* set RX status to 0 because no new message has arrived */ |
| 19001 | L4_MABX_B.SFunction1_o3_p = 0.0; |
| 19002 | } |
| 19003 | } |
| 19004 | } |
| 19005 | |
| 19006 | /* End of Outputs for SubSystem: '<S616>/CAN_TYPE1_RX_M2_C1' */ |
| 19007 | |
| 19008 | /* DataTypeConversion: '<S616>/Data Type Conversion' */ |
| 19009 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_n0; |
| 19010 | if (PositionFinalLimited < 256.0) { |
| 19011 | if (PositionFinalLimited >= 0.0) { |
| 19012 | starting_index = (uint8_T)PositionFinalLimited; |
| 19013 | } else { |
| 19014 | starting_index = 0U; |
| 19015 | } |
| 19016 | } else { |
| 19017 | starting_index = MAX_uint8_T; |
| 19018 | } |
| 19019 | |
| 19020 | L4_MABX_B.DataTypeConversion_hv = starting_index; |
| 19021 | |
| 19022 | /* End of DataTypeConversion: '<S616>/Data Type Conversion' */ |
| 19023 | |
| 19024 | /* DataTypeConversion: '<S616>/Data Type Conversion2' */ |
| 19025 | L4_MABX_B.EPBPCMInhibitStatusFeedback = (ENUM_XPR_FEEDBACK_T) |
| 19026 | L4_MABX_B.DataTypeConversion_hv; |
| 19027 | |
| 19028 | /* MultiPortSwitch: '<S452>/Multiport_Switch' incorporates: |
| 19029 | * Constant: '<S452>/Constant' |
| 19030 | */ |
| 19031 | switch (CANR_PROPB_XPR_1_50_CHANNEL_APV) { |
| 19032 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 19033 | /* DataTypeConversion: '<S614>/Data Type Conversion' */ |
| 19034 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_nn; |
| 19035 | if (PositionFinalLimited < 256.0) { |
| 19036 | if (PositionFinalLimited >= 0.0) { |
| 19037 | starting_index = (uint8_T)PositionFinalLimited; |
| 19038 | } else { |
| 19039 | starting_index = 0U; |
| 19040 | } |
| 19041 | } else { |
| 19042 | starting_index = MAX_uint8_T; |
| 19043 | } |
| 19044 | |
| 19045 | L4_MABX_B.DataTypeConversion_pd = starting_index; |
| 19046 | |
| 19047 | /* End of DataTypeConversion: '<S614>/Data Type Conversion' */ |
| 19048 | |
| 19049 | /* DataTypeConversion: '<S614>/Data Type Conversion2' */ |
| 19050 | L4_MABX_B.EPBPCMInhibitStatusFeedback_g = (ENUM_XPR_FEEDBACK_T) |
| 19051 | L4_MABX_B.DataTypeConversion_pd; |
| 19052 | L4_MABX_B.EPBPCMInhibitStatusFeedback_i = |
| 19053 | L4_MABX_B.EPBPCMInhibitStatusFeedback_g; |
| 19054 | break; |
| 19055 | |
| 19056 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 19057 | /* DataTypeConversion: '<S615>/Data Type Conversion' */ |
| 19058 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_lae; |
| 19059 | if (PositionFinalLimited < 256.0) { |
| 19060 | if (PositionFinalLimited >= 0.0) { |
| 19061 | starting_index = (uint8_T)PositionFinalLimited; |
| 19062 | } else { |
| 19063 | starting_index = 0U; |
| 19064 | } |
| 19065 | } else { |
| 19066 | starting_index = MAX_uint8_T; |
| 19067 | } |
| 19068 | |
| 19069 | L4_MABX_B.DataTypeConversion_ai = starting_index; |
| 19070 | |
| 19071 | /* End of DataTypeConversion: '<S615>/Data Type Conversion' */ |
| 19072 | |
| 19073 | /* DataTypeConversion: '<S615>/Data Type Conversion2' */ |
| 19074 | L4_MABX_B.EPBPCMInhibitStatusFeedback_k = (ENUM_XPR_FEEDBACK_T) |
| 19075 | L4_MABX_B.DataTypeConversion_ai; |
| 19076 | L4_MABX_B.EPBPCMInhibitStatusFeedback_i = |
| 19077 | L4_MABX_B.EPBPCMInhibitStatusFeedback_k; |
| 19078 | break; |
| 19079 | |
| 19080 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 19081 | L4_MABX_B.EPBPCMInhibitStatusFeedback_i = |
| 19082 | L4_MABX_B.EPBPCMInhibitStatusFeedback; |
| 19083 | break; |
| 19084 | |
| 19085 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 19086 | L4_MABX_B.EPBPCMInhibitStatusFeedback_i = |
| 19087 | L4_MABX_B.EPBPCMInhibitStatusFeedback; |
| 19088 | break; |
| 19089 | |
| 19090 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 19091 | L4_MABX_B.EPBPCMInhibitStatusFeedback_i = |
| 19092 | L4_MABX_B.EPBPCMInhibitStatusFeedback; |
| 19093 | break; |
| 19094 | |
| 19095 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 19096 | L4_MABX_B.EPBPCMInhibitStatusFeedback_i = |
| 19097 | L4_MABX_B.EPBPCMInhibitStatusFeedback; |
| 19098 | break; |
| 19099 | |
| 19100 | default: |
| 19101 | L4_MABX_B.EPBPCMInhibitStatusFeedback_i = |
| 19102 | L4_MABX_B.EPBPCMInhibitStatusFeedback; |
| 19103 | break; |
| 19104 | } |
| 19105 | |
| 19106 | /* DataTypeConversion: '<S616>/Data Type Conversion1' */ |
| 19107 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_fk; |
| 19108 | if (PositionFinalLimited < 256.0) { |
| 19109 | if (PositionFinalLimited >= 0.0) { |
| 19110 | starting_index = (uint8_T)PositionFinalLimited; |
| 19111 | } else { |
| 19112 | starting_index = 0U; |
| 19113 | } |
| 19114 | } else { |
| 19115 | starting_index = MAX_uint8_T; |
| 19116 | } |
| 19117 | |
| 19118 | L4_MABX_B.DataTypeConversion1_m4 = starting_index; |
| 19119 | |
| 19120 | /* End of DataTypeConversion: '<S616>/Data Type Conversion1' */ |
| 19121 | |
| 19122 | /* DataTypeConversion: '<S616>/Data Type Conversion3' */ |
| 19123 | L4_MABX_B.EPBPCMManualStatusFeedback = (ENUM_XPR_FEEDBACK_T) |
| 19124 | L4_MABX_B.DataTypeConversion1_m4; |
| 19125 | |
| 19126 | /* MultiPortSwitch: '<S452>/Multiport_Switch' incorporates: |
| 19127 | * Constant: '<S452>/Constant' |
| 19128 | */ |
| 19129 | switch (CANR_PROPB_XPR_1_50_CHANNEL_APV) { |
| 19130 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 19131 | /* DataTypeConversion: '<S614>/Data Type Conversion1' */ |
| 19132 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_pn; |
| 19133 | if (PositionFinalLimited < 256.0) { |
| 19134 | if (PositionFinalLimited >= 0.0) { |
| 19135 | starting_index = (uint8_T)PositionFinalLimited; |
| 19136 | } else { |
| 19137 | starting_index = 0U; |
| 19138 | } |
| 19139 | } else { |
| 19140 | starting_index = MAX_uint8_T; |
| 19141 | } |
| 19142 | |
| 19143 | L4_MABX_B.DataTypeConversion1_ci = starting_index; |
| 19144 | |
| 19145 | /* End of DataTypeConversion: '<S614>/Data Type Conversion1' */ |
| 19146 | |
| 19147 | /* DataTypeConversion: '<S614>/Data Type Conversion3' */ |
| 19148 | L4_MABX_B.EPBPCMManualStatusFeedback_g = (ENUM_XPR_FEEDBACK_T) |
| 19149 | L4_MABX_B.DataTypeConversion1_ci; |
| 19150 | L4_MABX_B.EPBPCMManualStatusFeedback_j = |
| 19151 | L4_MABX_B.EPBPCMManualStatusFeedback_g; |
| 19152 | break; |
| 19153 | |
| 19154 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 19155 | /* DataTypeConversion: '<S615>/Data Type Conversion1' */ |
| 19156 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_bh; |
| 19157 | if (PositionFinalLimited < 256.0) { |
| 19158 | if (PositionFinalLimited >= 0.0) { |
| 19159 | starting_index = (uint8_T)PositionFinalLimited; |
| 19160 | } else { |
| 19161 | starting_index = 0U; |
| 19162 | } |
| 19163 | } else { |
| 19164 | starting_index = MAX_uint8_T; |
| 19165 | } |
| 19166 | |
| 19167 | L4_MABX_B.DataTypeConversion1_hx = starting_index; |
| 19168 | |
| 19169 | /* End of DataTypeConversion: '<S615>/Data Type Conversion1' */ |
| 19170 | |
| 19171 | /* DataTypeConversion: '<S615>/Data Type Conversion3' */ |
| 19172 | L4_MABX_B.EPBPCMManualStatusFeedback_h = (ENUM_XPR_FEEDBACK_T) |
| 19173 | L4_MABX_B.DataTypeConversion1_hx; |
| 19174 | L4_MABX_B.EPBPCMManualStatusFeedback_j = |
| 19175 | L4_MABX_B.EPBPCMManualStatusFeedback_h; |
| 19176 | break; |
| 19177 | |
| 19178 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 19179 | L4_MABX_B.EPBPCMManualStatusFeedback_j = |
| 19180 | L4_MABX_B.EPBPCMManualStatusFeedback; |
| 19181 | break; |
| 19182 | |
| 19183 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 19184 | L4_MABX_B.EPBPCMManualStatusFeedback_j = |
| 19185 | L4_MABX_B.EPBPCMManualStatusFeedback; |
| 19186 | break; |
| 19187 | |
| 19188 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 19189 | L4_MABX_B.EPBPCMManualStatusFeedback_j = |
| 19190 | L4_MABX_B.EPBPCMManualStatusFeedback; |
| 19191 | break; |
| 19192 | |
| 19193 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 19194 | L4_MABX_B.EPBPCMManualStatusFeedback_j = |
| 19195 | L4_MABX_B.EPBPCMManualStatusFeedback; |
| 19196 | break; |
| 19197 | |
| 19198 | default: |
| 19199 | L4_MABX_B.EPBPCMManualStatusFeedback_j = |
| 19200 | L4_MABX_B.EPBPCMManualStatusFeedback; |
| 19201 | break; |
| 19202 | } |
| 19203 | |
| 19204 | /* DataTypeConversion: '<S616>/Data Type Conversion8' */ |
| 19205 | L4_MABX_B.RX_status_m = (L4_MABX_B.SFunction1_o3_p != 0.0); |
| 19206 | |
| 19207 | /* MultiPortSwitch: '<S452>/Multiport_Switch' incorporates: |
| 19208 | * Constant: '<S452>/Constant' |
| 19209 | */ |
| 19210 | switch (CANR_PROPB_XPR_1_50_CHANNEL_APV) { |
| 19211 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 19212 | /* DataTypeConversion: '<S614>/Data Type Conversion8' */ |
| 19213 | L4_MABX_B.RX_status_nm = (L4_MABX_B.SFunction1_o3_jj != 0.0); |
| 19214 | L4_MABX_B.RX_status_dz = L4_MABX_B.RX_status_nm; |
| 19215 | break; |
| 19216 | |
| 19217 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 19218 | /* DataTypeConversion: '<S615>/Data Type Conversion8' */ |
| 19219 | L4_MABX_B.RX_status_on = (L4_MABX_B.SFunction1_o3_gz != 0.0); |
| 19220 | L4_MABX_B.RX_status_dz = L4_MABX_B.RX_status_on; |
| 19221 | break; |
| 19222 | |
| 19223 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 19224 | L4_MABX_B.RX_status_dz = L4_MABX_B.RX_status_m; |
| 19225 | break; |
| 19226 | |
| 19227 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 19228 | L4_MABX_B.RX_status_dz = L4_MABX_B.RX_status_m; |
| 19229 | break; |
| 19230 | |
| 19231 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 19232 | L4_MABX_B.RX_status_dz = L4_MABX_B.RX_status_m; |
| 19233 | break; |
| 19234 | |
| 19235 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 19236 | L4_MABX_B.RX_status_dz = L4_MABX_B.RX_status_m; |
| 19237 | break; |
| 19238 | |
| 19239 | default: |
| 19240 | L4_MABX_B.RX_status_dz = L4_MABX_B.RX_status_m; |
| 19241 | break; |
| 19242 | } |
| 19243 | |
| 19244 | /* DataTypeConversion: '<S616>/Data Type Conversion9' */ |
| 19245 | L4_MABX_B.RX_time_fr = L4_MABX_B.SFunction1_o4_au; |
| 19246 | |
| 19247 | /* MultiPortSwitch: '<S452>/Multiport_Switch' incorporates: |
| 19248 | * Constant: '<S452>/Constant' |
| 19249 | */ |
| 19250 | switch (CANR_PROPB_XPR_1_50_CHANNEL_APV) { |
| 19251 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 19252 | /* DataTypeConversion: '<S614>/Data Type Conversion9' */ |
| 19253 | L4_MABX_B.RX_time_gc = L4_MABX_B.SFunction1_o4_i; |
| 19254 | L4_MABX_B.RX_time_dy = L4_MABX_B.RX_time_gc; |
| 19255 | break; |
| 19256 | |
| 19257 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 19258 | /* DataTypeConversion: '<S615>/Data Type Conversion9' */ |
| 19259 | L4_MABX_B.RX_time_lu = L4_MABX_B.SFunction1_o4_hf3; |
| 19260 | L4_MABX_B.RX_time_dy = L4_MABX_B.RX_time_lu; |
| 19261 | break; |
| 19262 | |
| 19263 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 19264 | L4_MABX_B.RX_time_dy = L4_MABX_B.RX_time_fr; |
| 19265 | break; |
| 19266 | |
| 19267 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 19268 | L4_MABX_B.RX_time_dy = L4_MABX_B.RX_time_fr; |
| 19269 | break; |
| 19270 | |
| 19271 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 19272 | L4_MABX_B.RX_time_dy = L4_MABX_B.RX_time_fr; |
| 19273 | break; |
| 19274 | |
| 19275 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 19276 | L4_MABX_B.RX_time_dy = L4_MABX_B.RX_time_fr; |
| 19277 | break; |
| 19278 | |
| 19279 | default: |
| 19280 | L4_MABX_B.RX_time_dy = L4_MABX_B.RX_time_fr; |
| 19281 | break; |
| 19282 | } |
| 19283 | |
| 19284 | /* DataTypeConversion: '<S616>/Data Type Conversion10' */ |
| 19285 | L4_MABX_B.RX_delta_time_h = L4_MABX_B.SFunction1_o5_ne; |
| 19286 | |
| 19287 | /* MultiPortSwitch: '<S452>/Multiport_Switch' incorporates: |
| 19288 | * Constant: '<S452>/Constant' |
| 19289 | */ |
| 19290 | switch (CANR_PROPB_XPR_1_50_CHANNEL_APV) { |
| 19291 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 19292 | /* DataTypeConversion: '<S614>/Data Type Conversion10' */ |
| 19293 | L4_MABX_B.RX_delta_time_drb = L4_MABX_B.SFunction1_o5_k; |
| 19294 | L4_MABX_B.RX_delta_time_at = L4_MABX_B.RX_delta_time_drb; |
| 19295 | break; |
| 19296 | |
| 19297 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 19298 | /* DataTypeConversion: '<S615>/Data Type Conversion10' */ |
| 19299 | L4_MABX_B.RX_delta_time_bu = L4_MABX_B.SFunction1_o5_p5; |
| 19300 | L4_MABX_B.RX_delta_time_at = L4_MABX_B.RX_delta_time_bu; |
| 19301 | break; |
| 19302 | |
| 19303 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 19304 | L4_MABX_B.RX_delta_time_at = L4_MABX_B.RX_delta_time_h; |
| 19305 | break; |
| 19306 | |
| 19307 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 19308 | L4_MABX_B.RX_delta_time_at = L4_MABX_B.RX_delta_time_h; |
| 19309 | break; |
| 19310 | |
| 19311 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 19312 | L4_MABX_B.RX_delta_time_at = L4_MABX_B.RX_delta_time_h; |
| 19313 | break; |
| 19314 | |
| 19315 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 19316 | L4_MABX_B.RX_delta_time_at = L4_MABX_B.RX_delta_time_h; |
| 19317 | break; |
| 19318 | |
| 19319 | default: |
| 19320 | L4_MABX_B.RX_delta_time_at = L4_MABX_B.RX_delta_time_h; |
| 19321 | break; |
| 19322 | } |
| 19323 | |
| 19324 | /* RelationalOperator: '<S624>/Operator' incorporates: |
| 19325 | * Constant: '<S452>/Constant' |
| 19326 | * Constant: '<S617>/Constant3' |
| 19327 | */ |
| 19328 | L4_MABX_B.Operator_kv = (CANR_PROPB_XPR_1_50_CHANNEL_APV == |
| 19329 | L4_MABX_P.Constant3_Value_e); |
| 19330 | |
| 19331 | /* RelationalOperator: '<S625>/Operator' incorporates: |
| 19332 | * Constant: '<S452>/Constant' |
| 19333 | * Constant: '<S617>/Constant4' |
| 19334 | */ |
| 19335 | L4_MABX_B.Operator_mb = (CANR_PROPB_XPR_1_50_CHANNEL_APV == |
| 19336 | L4_MABX_P.Constant4_Value_oe); |
| 19337 | |
| 19338 | /* RelationalOperator: '<S626>/Operator' incorporates: |
| 19339 | * Constant: '<S452>/Constant' |
| 19340 | * Constant: '<S617>/Constant5' |
| 19341 | */ |
| 19342 | L4_MABX_B.Operator_iz3 = (CANR_PROPB_XPR_1_50_CHANNEL_APV == |
| 19343 | L4_MABX_P.Constant5_Value_g); |
| 19344 | |
| 19345 | /* Outputs for Enabled SubSystem: '<S627>/PX2_LaneEdgeLeft' incorporates: |
| 19346 | * EnablePort: '<S628>/Enable' |
| 19347 | */ |
| 19348 | /* Constant: '<S453>/Constant' */ |
| 19349 | if (L4_MABX_P.Constant_Value_kr) { |
| 19350 | /* S-Function (rti_commonblock): '<S628>/S-Function1' */ |
| 19351 | /* This comment workarounds a code generation problem */ |
| 19352 | |
| 19353 | /* dSPACE RTICAN RX Message Block: "PX2_LaneEdgeLeft" Id:770 */ |
| 19354 | { |
| 19355 | UInt32 *CAN_Msg; |
| 19356 | static dsfloat time_old = 0.0; |
| 19357 | |
| 19358 | /* Read status and timestamp info (previous message) */ |
| 19359 | if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x302].timestamp != |
| 19360 | time_old) { |
| 19361 | /* ... save timestamp info for the calculation of the RX status |
| 19362 | during the consecutive sample hit*/ |
| 19363 | time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x302].timestamp; |
| 19364 | |
| 19365 | /* ... set the processed flag to one */ |
| 19366 | L4_MABX_B.SFunction1_o4_fz = 1.0; |
| 19367 | L4_MABX_B.SFunction1_o5_e = (real_T) |
| 19368 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x302].timestamp; |
| 19369 | L4_MABX_B.SFunction1_o6_l0 = (real_T) |
| 19370 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x302].deltatime; |
| 19371 | CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x302].data; |
| 19372 | |
| 19373 | /* Decode CAN message */ |
| 19374 | { |
| 19375 | { |
| 19376 | rtican_Signal_t CAN_Sgn; |
| 19377 | |
| 19378 | /* ...... "PX2_LaneEdgeLeftAngle" (0|16, standard signal, signed int, little endian) */ |
| 19379 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 19380 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 19381 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19382 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19383 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19384 | } |
| 19385 | |
| 19386 | L4_MABX_B.SFunction1_o1_mj = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 19387 | |
| 19388 | /* ...... "PX2_LaneEdgeLeftNumPoints" (16|8, standard signal, unsigned int, little endian) */ |
| 19389 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 19390 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 19391 | L4_MABX_B.SFunction1_o2_ls = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19392 | |
| 19393 | /* ...... "PX2_LaneEdgeLeftPosition" (24|16, standard signal, signed int, little endian) */ |
| 19394 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 19395 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 19396 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19397 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19398 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19399 | } |
| 19400 | |
| 19401 | L4_MABX_B.SFunction1_o3_c1 = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 19402 | } |
| 19403 | } |
| 19404 | } else { |
| 19405 | /* set RX status to 0 because no new message has arrived */ |
| 19406 | L4_MABX_B.SFunction1_o4_fz = 0.0; |
| 19407 | } |
| 19408 | } |
| 19409 | } |
| 19410 | |
| 19411 | /* End of Outputs for SubSystem: '<S627>/PX2_LaneEdgeLeft' */ |
| 19412 | |
| 19413 | /* DataTypeConversion: '<S627>/Data Type Conversion1' */ |
| 19414 | L4_MABX_B.RX_delta_time_o0 = L4_MABX_B.SFunction1_o6_l0; |
| 19415 | |
| 19416 | /* DataTypeConversion: '<S627>/Data Type Conversion10' */ |
| 19417 | L4_MABX_B.RX_delta_time_i0 = L4_MABX_B.SFunction1_o7_d; |
| 19418 | |
| 19419 | /* DataTypeConversion: '<S627>/Data Type Conversion2' */ |
| 19420 | L4_MABX_B.RX_status_bx = (L4_MABX_B.SFunction1_o4_fz != 0.0); |
| 19421 | |
| 19422 | /* DataTypeConversion: '<S627>/Data Type Conversion3' */ |
| 19423 | L4_MABX_B.RX_time_jb = L4_MABX_B.SFunction1_o5_e; |
| 19424 | |
| 19425 | /* Outputs for Enabled SubSystem: '<S627>/PX2_LaneEdgeRight' incorporates: |
| 19426 | * EnablePort: '<S629>/Enable' |
| 19427 | */ |
| 19428 | /* Constant: '<S453>/Constant' */ |
| 19429 | if (L4_MABX_P.Constant_Value_kr) { |
| 19430 | /* S-Function (rti_commonblock): '<S629>/S-Function1' */ |
| 19431 | /* This comment workarounds a code generation problem */ |
| 19432 | |
| 19433 | /* dSPACE RTICAN RX Message Block: "PX2_LaneEdgeRight" Id:771 */ |
| 19434 | { |
| 19435 | UInt32 *CAN_Msg; |
| 19436 | static dsfloat time_old = 0.0; |
| 19437 | |
| 19438 | /* Read status and timestamp info (previous message) */ |
| 19439 | if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x303].timestamp != |
| 19440 | time_old) { |
| 19441 | /* ... save timestamp info for the calculation of the RX status |
| 19442 | during the consecutive sample hit*/ |
| 19443 | time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x303].timestamp; |
| 19444 | |
| 19445 | /* ... set the processed flag to one */ |
| 19446 | L4_MABX_B.SFunction1_o4_dh = 1.0; |
| 19447 | L4_MABX_B.SFunction1_o5_fm = (real_T) |
| 19448 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x303].timestamp; |
| 19449 | L4_MABX_B.SFunction1_o6_h = (real_T) |
| 19450 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x303].deltatime; |
| 19451 | CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x303].data; |
| 19452 | |
| 19453 | /* Decode CAN message */ |
| 19454 | { |
| 19455 | { |
| 19456 | rtican_Signal_t CAN_Sgn; |
| 19457 | |
| 19458 | /* ...... "PX2_LaneEdgeRightAngle" (0|16, standard signal, signed int, little endian) */ |
| 19459 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 19460 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 19461 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19462 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19463 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19464 | } |
| 19465 | |
| 19466 | L4_MABX_B.SFunction1_o1_i2 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 19467 | |
| 19468 | /* ...... "PX2_LaneEdgeRightNumPoints" (16|8, standard signal, unsigned int, little endian) */ |
| 19469 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 19470 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 19471 | L4_MABX_B.SFunction1_o2_dg = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19472 | |
| 19473 | /* ...... "PX2_LaneEdgeRightPosition" (24|16, standard signal, signed int, little endian) */ |
| 19474 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 19475 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 19476 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19477 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19478 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19479 | } |
| 19480 | |
| 19481 | L4_MABX_B.SFunction1_o3_ad = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 19482 | } |
| 19483 | } |
| 19484 | } else { |
| 19485 | /* set RX status to 0 because no new message has arrived */ |
| 19486 | L4_MABX_B.SFunction1_o4_dh = 0.0; |
| 19487 | } |
| 19488 | } |
| 19489 | } |
| 19490 | |
| 19491 | /* End of Outputs for SubSystem: '<S627>/PX2_LaneEdgeRight' */ |
| 19492 | |
| 19493 | /* DataTypeConversion: '<S627>/Data Type Conversion4' */ |
| 19494 | L4_MABX_B.RX_delta_time_hh = L4_MABX_B.SFunction1_o6_h; |
| 19495 | |
| 19496 | /* DataTypeConversion: '<S627>/Data Type Conversion5' */ |
| 19497 | L4_MABX_B.RX_status_p1 = (L4_MABX_B.SFunction1_o4_dh != 0.0); |
| 19498 | |
| 19499 | /* DataTypeConversion: '<S627>/Data Type Conversion6' */ |
| 19500 | L4_MABX_B.RX_time_k = L4_MABX_B.SFunction1_o5_fm; |
| 19501 | |
| 19502 | /* DataTypeConversion: '<S627>/Data Type Conversion8' */ |
| 19503 | L4_MABX_B.RX_status_o = (L4_MABX_B.SFunction1_o5_b != 0.0); |
| 19504 | |
| 19505 | /* DataTypeConversion: '<S627>/Data Type Conversion9' */ |
| 19506 | L4_MABX_B.RX_time_n3 = L4_MABX_B.SFunction1_o6_kc; |
| 19507 | |
| 19508 | /* Switch: '<S631>/Switch' */ |
| 19509 | if (L4_MABX_B.If_Then_Else.Switch) { |
| 19510 | /* DataTypeConversion: '<S631>/Data Type Conversion8' */ |
| 19511 | L4_MABX_B.RX_status_h0 = (L4_MABX_B.SFunction1_o3_bt != 0.0); |
| 19512 | L4_MABX_B.RX_status_ji = L4_MABX_B.RX_status_h0; |
| 19513 | |
| 19514 | /* DataTypeConversion: '<S631>/Data Type Conversion9' */ |
| 19515 | L4_MABX_B.RX_time_fi = L4_MABX_B.SFunction1_o4_ez; |
| 19516 | L4_MABX_B.RX_time_dr = L4_MABX_B.RX_time_fi; |
| 19517 | |
| 19518 | /* DataTypeConversion: '<S631>/Data Type Conversion10' */ |
| 19519 | L4_MABX_B.RX_delta_time_e = L4_MABX_B.SFunction1_o5_gx; |
| 19520 | L4_MABX_B.RX_delta_time_ia = L4_MABX_B.RX_delta_time_e; |
| 19521 | } else { |
| 19522 | /* DataTypeConversion: '<S631>/Data Type Conversion3' */ |
| 19523 | L4_MABX_B.RX_status_mm = (L4_MABX_B.SFunction1_o3_a != 0.0); |
| 19524 | L4_MABX_B.RX_status_ji = L4_MABX_B.RX_status_mm; |
| 19525 | |
| 19526 | /* DataTypeConversion: '<S631>/Data Type Conversion2' */ |
| 19527 | L4_MABX_B.RX_time_e5 = L4_MABX_B.SFunction1_o4_ex; |
| 19528 | L4_MABX_B.RX_time_dr = L4_MABX_B.RX_time_e5; |
| 19529 | |
| 19530 | /* DataTypeConversion: '<S631>/Data Type Conversion1' */ |
| 19531 | L4_MABX_B.RX_delta_time_lo = L4_MABX_B.SFunction1_o5_nb; |
| 19532 | L4_MABX_B.RX_delta_time_ia = L4_MABX_B.RX_delta_time_lo; |
| 19533 | } |
| 19534 | |
| 19535 | /* DataTypeConversion: '<S634>/Data Type Conversion1' */ |
| 19536 | L4_MABX_B.XPR1ControlStatus = L4_MABX_B.SFunction1_o6_a; |
| 19537 | |
| 19538 | /* DataTypeConversion: '<S634>/Data Type Conversion10' */ |
| 19539 | L4_MABX_B.RX_delta_time_hs = L4_MABX_B.SFunction1_o13_g; |
| 19540 | |
| 19541 | /* DataTypeConversion: '<S634>/Data Type Conversion2' */ |
| 19542 | L4_MABX_B.XPR2ControlStatus = L4_MABX_B.SFunction1_o7_a; |
| 19543 | |
| 19544 | /* DataTypeConversion: '<S634>/Data Type Conversion3' */ |
| 19545 | L4_MABX_B.XPR3ControlStatus = L4_MABX_B.SFunction1_o8_b; |
| 19546 | |
| 19547 | /* DataTypeConversion: '<S634>/Data Type Conversion8' */ |
| 19548 | L4_MABX_B.RX_status_jk = (L4_MABX_B.SFunction1_o11_d != 0.0); |
| 19549 | |
| 19550 | /* DataTypeConversion: '<S634>/Data Type Conversion9' */ |
| 19551 | L4_MABX_B.RX_time_gh = L4_MABX_B.SFunction1_o12_k; |
| 19552 | |
| 19553 | /* DataTypeConversion: '<S636>/Data Type Conversion10' */ |
| 19554 | L4_MABX_B.RX_delta_time_dq = L4_MABX_B.SFunction1_o10_ha; |
| 19555 | |
| 19556 | /* DataTypeConversion: '<S636>/Data Type Conversion8' */ |
| 19557 | L4_MABX_B.RX_status_oh = (L4_MABX_B.SFunction1_o8_h != 0.0); |
| 19558 | |
| 19559 | /* DataTypeConversion: '<S636>/Data Type Conversion9' */ |
| 19560 | L4_MABX_B.RX_time_e = L4_MABX_B.SFunction1_o9_i; |
| 19561 | |
| 19562 | /* Outputs for Enabled SubSystem: '<S638>/PX2_MapLaneEgoLeft' incorporates: |
| 19563 | * EnablePort: '<S639>/Enable' |
| 19564 | */ |
| 19565 | /* Constant: '<S457>/CAN_RX-Enable_PX2_MapLaneEgoLeft' */ |
| 19566 | if (L4_MABX_P.CAN_RXEnable_PX2_MapLaneEgoLeft) { |
| 19567 | /* S-Function (rti_commonblock): '<S639>/S-Function1' */ |
| 19568 | /* This comment workarounds a code generation problem */ |
| 19569 | |
| 19570 | /* dSPACE RTICAN RX Message Block: "PX2_MapLaneEgoLeft" Id:1542 */ |
| 19571 | { |
| 19572 | UInt32 *CAN_Msg; |
| 19573 | static dsfloat time_old = 0.0; |
| 19574 | |
| 19575 | /* Read status and timestamp info (previous message) */ |
| 19576 | if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x606].timestamp != |
| 19577 | time_old) { |
| 19578 | /* ... save timestamp info for the calculation of the RX status |
| 19579 | during the consecutive sample hit*/ |
| 19580 | time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x606].timestamp; |
| 19581 | |
| 19582 | /* ... set the processed flag to one */ |
| 19583 | L4_MABX_B.SFunction1_o7_c5 = 1.0; |
| 19584 | L4_MABX_B.SFunction1_o8_e = (real_T) |
| 19585 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x606].timestamp; |
| 19586 | L4_MABX_B.SFunction1_o9_g = (real_T) |
| 19587 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x606].deltatime; |
| 19588 | CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x606].data; |
| 19589 | |
| 19590 | /* Decode CAN message */ |
| 19591 | { |
| 19592 | { |
| 19593 | rtican_Signal_t CAN_Sgn; |
| 19594 | |
| 19595 | /* ...... "PX2_MapLaneNearPos" (0|16, standard signal, signed int, little endian) */ |
| 19596 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 19597 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 19598 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19599 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19600 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19601 | } |
| 19602 | |
| 19603 | L4_MABX_B.SFunction1_o1_ed = 0.00390625 * ( ((real_T) |
| 19604 | CAN_Sgn.SignedSgn) ); |
| 19605 | |
| 19606 | /* ...... "PX2_MapLaneMidPos" (16|16, standard signal, signed int, little endian) */ |
| 19607 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 19608 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 19609 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19610 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19611 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19612 | } |
| 19613 | |
| 19614 | L4_MABX_B.SFunction1_o2_iv = 0.00390625 * ( ((real_T) |
| 19615 | CAN_Sgn.SignedSgn) ); |
| 19616 | |
| 19617 | /* ...... "PX2_MapLaneFarPos" (32|16, standard signal, signed int, little endian) */ |
| 19618 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 19619 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 19620 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19621 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19622 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19623 | } |
| 19624 | |
| 19625 | L4_MABX_B.SFunction1_o3_df = 0.00390625 * ( ((real_T) |
| 19626 | CAN_Sgn.SignedSgn) ); |
| 19627 | |
| 19628 | /* ...... "PX2_EgoLaneNearPosValid" (48|2, standard signal, unsigned int, little endian) */ |
| 19629 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19630 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19631 | L4_MABX_B.SFunction1_o4_ak = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19632 | |
| 19633 | /* ...... "PX2_EgoLaneMidPosValid" (50|2, standard signal, unsigned int, little endian) */ |
| 19634 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19635 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 19636 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19637 | L4_MABX_B.SFunction1_o5_f1 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19638 | |
| 19639 | /* ...... "PX2_EgoLaneFarPosValid" (52|2, standard signal, unsigned int, little endian) */ |
| 19640 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19641 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 19642 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19643 | L4_MABX_B.SFunction1_o6_i = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19644 | } |
| 19645 | } |
| 19646 | } else { |
| 19647 | /* set RX status to 0 because no new message has arrived */ |
| 19648 | L4_MABX_B.SFunction1_o7_c5 = 0.0; |
| 19649 | } |
| 19650 | } |
| 19651 | } |
| 19652 | |
| 19653 | /* End of Constant: '<S457>/CAN_RX-Enable_PX2_MapLaneEgoLeft' */ |
| 19654 | /* End of Outputs for SubSystem: '<S638>/PX2_MapLaneEgoLeft' */ |
| 19655 | |
| 19656 | /* DataTypeConversion: '<S638>/Data Type Conversion10' */ |
| 19657 | L4_MABX_B.RX_delta_time_iv = L4_MABX_B.SFunction1_o9_g; |
| 19658 | |
| 19659 | /* DataTypeConversion: '<S638>/Data Type Conversion8' */ |
| 19660 | L4_MABX_B.RX_status_av = (L4_MABX_B.SFunction1_o7_c5 != 0.0); |
| 19661 | |
| 19662 | /* DataTypeConversion: '<S638>/Data Type Conversion9' */ |
| 19663 | L4_MABX_B.RX_time_b = L4_MABX_B.SFunction1_o8_e; |
| 19664 | |
| 19665 | /* Outputs for Enabled SubSystem: '<S640>/PX2_MapLaneEgoRight' incorporates: |
| 19666 | * EnablePort: '<S641>/Enable' |
| 19667 | */ |
| 19668 | /* Constant: '<S458>/CAN_RX-Enable_PX2_MapLaneEgoLeft' */ |
| 19669 | if (L4_MABX_P.CAN_RXEnable_PX2_MapLaneEgoLe_a) { |
| 19670 | /* S-Function (rti_commonblock): '<S641>/S-Function1' */ |
| 19671 | /* This comment workarounds a code generation problem */ |
| 19672 | |
| 19673 | /* dSPACE RTICAN RX Message Block: "PX2_MapLaneEgoRight" Id:1541 */ |
| 19674 | { |
| 19675 | UInt32 *CAN_Msg; |
| 19676 | static dsfloat time_old = 0.0; |
| 19677 | |
| 19678 | /* Read status and timestamp info (previous message) */ |
| 19679 | if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x605].timestamp != |
| 19680 | time_old) { |
| 19681 | /* ... save timestamp info for the calculation of the RX status |
| 19682 | during the consecutive sample hit*/ |
| 19683 | time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x605].timestamp; |
| 19684 | |
| 19685 | /* ... set the processed flag to one */ |
| 19686 | L4_MABX_B.SFunction1_o7_fg = 1.0; |
| 19687 | L4_MABX_B.SFunction1_o8_a = (real_T) |
| 19688 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x605].timestamp; |
| 19689 | L4_MABX_B.SFunction1_o9_k = (real_T) |
| 19690 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x605].deltatime; |
| 19691 | CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x605].data; |
| 19692 | |
| 19693 | /* Decode CAN message */ |
| 19694 | { |
| 19695 | { |
| 19696 | rtican_Signal_t CAN_Sgn; |
| 19697 | |
| 19698 | /* ...... "PX2_MapLaneNearPos" (0|16, standard signal, signed int, little endian) */ |
| 19699 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 19700 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 19701 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19702 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19703 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19704 | } |
| 19705 | |
| 19706 | L4_MABX_B.SFunction1_o1_m5 = 0.00390625 * ( ((real_T) |
| 19707 | CAN_Sgn.SignedSgn) ); |
| 19708 | |
| 19709 | /* ...... "PX2_MapLaneMidPos" (16|16, standard signal, signed int, little endian) */ |
| 19710 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 19711 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 19712 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19713 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19714 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19715 | } |
| 19716 | |
| 19717 | L4_MABX_B.SFunction1_o2_dv = 0.00390625 * ( ((real_T) |
| 19718 | CAN_Sgn.SignedSgn) ); |
| 19719 | |
| 19720 | /* ...... "PX2_MapLaneFarPos" (32|16, standard signal, signed int, little endian) */ |
| 19721 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 19722 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 19723 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19724 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19725 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19726 | } |
| 19727 | |
| 19728 | L4_MABX_B.SFunction1_o3_em = 0.00390625 * ( ((real_T) |
| 19729 | CAN_Sgn.SignedSgn) ); |
| 19730 | |
| 19731 | /* ...... "PX2_EgoLaneNearPosValid" (48|2, standard signal, unsigned int, little endian) */ |
| 19732 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19733 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19734 | L4_MABX_B.SFunction1_o4_mn = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19735 | |
| 19736 | /* ...... "PX2_EgoLaneMidPosValid" (50|2, standard signal, unsigned int, little endian) */ |
| 19737 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19738 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 19739 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19740 | L4_MABX_B.SFunction1_o5_gr = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19741 | |
| 19742 | /* ...... "PX2_EgoLaneFarPosValid" (52|2, standard signal, unsigned int, little endian) */ |
| 19743 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19744 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 19745 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19746 | L4_MABX_B.SFunction1_o6_n = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19747 | } |
| 19748 | } |
| 19749 | } else { |
| 19750 | /* set RX status to 0 because no new message has arrived */ |
| 19751 | L4_MABX_B.SFunction1_o7_fg = 0.0; |
| 19752 | } |
| 19753 | } |
| 19754 | } |
| 19755 | |
| 19756 | /* End of Constant: '<S458>/CAN_RX-Enable_PX2_MapLaneEgoLeft' */ |
| 19757 | /* End of Outputs for SubSystem: '<S640>/PX2_MapLaneEgoRight' */ |
| 19758 | |
| 19759 | /* DataTypeConversion: '<S640>/Data Type Conversion10' */ |
| 19760 | L4_MABX_B.RX_delta_time_dr = L4_MABX_B.SFunction1_o9_k; |
| 19761 | |
| 19762 | /* DataTypeConversion: '<S640>/Data Type Conversion8' */ |
| 19763 | L4_MABX_B.RX_status_kd = (L4_MABX_B.SFunction1_o7_fg != 0.0); |
| 19764 | |
| 19765 | /* DataTypeConversion: '<S640>/Data Type Conversion9' */ |
| 19766 | L4_MABX_B.RX_time_fs = L4_MABX_B.SFunction1_o8_a; |
| 19767 | |
| 19768 | /* Outputs for Enabled SubSystem: '<S642>/PX2_EgoLanePos' incorporates: |
| 19769 | * EnablePort: '<S643>/Enable' |
| 19770 | */ |
| 19771 | /* Constant: '<S459>/Constant' */ |
| 19772 | if (L4_MABX_P.Constant_Value_ij) { |
| 19773 | /* S-Function (rti_commonblock): '<S643>/S-Function1' */ |
| 19774 | /* This comment workarounds a code generation problem */ |
| 19775 | |
| 19776 | /* dSPACE RTICAN RX Message Block: "PX2_EgoLanePos" Id:1540 */ |
| 19777 | { |
| 19778 | UInt32 *CAN_Msg; |
| 19779 | static dsfloat time_old = 0.0; |
| 19780 | |
| 19781 | /* Read status and timestamp info (previous message) */ |
| 19782 | if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x604].timestamp != |
| 19783 | time_old) { |
| 19784 | /* ... save timestamp info for the calculation of the RX status |
| 19785 | during the consecutive sample hit*/ |
| 19786 | time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x604].timestamp; |
| 19787 | |
| 19788 | /* ... set the processed flag to one */ |
| 19789 | L4_MABX_B.SFunction1_o7_l = 1.0; |
| 19790 | L4_MABX_B.SFunction1_o8_n = (real_T) |
| 19791 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x604].timestamp; |
| 19792 | L4_MABX_B.SFunction1_o9_c = (real_T) |
| 19793 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x604].deltatime; |
| 19794 | CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x604].data; |
| 19795 | |
| 19796 | /* Decode CAN message */ |
| 19797 | { |
| 19798 | { |
| 19799 | rtican_Signal_t CAN_Sgn; |
| 19800 | |
| 19801 | /* ...... "PX2_EgoLaneNearPosErr" (0|16, standard signal, signed int, little endian) */ |
| 19802 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 19803 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 19804 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19805 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19806 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19807 | } |
| 19808 | |
| 19809 | L4_MABX_B.SFunction1_o1_kz = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 19810 | |
| 19811 | /* ...... "PX2_EgoLaneMidPosErr" (16|16, standard signal, signed int, little endian) */ |
| 19812 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 19813 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 19814 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19815 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19816 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19817 | } |
| 19818 | |
| 19819 | L4_MABX_B.SFunction1_o2_bb = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 19820 | |
| 19821 | /* ...... "PX2_EgoLaneFarPosErr" (32|16, standard signal, signed int, little endian) */ |
| 19822 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 19823 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 19824 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19825 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19826 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19827 | } |
| 19828 | |
| 19829 | L4_MABX_B.SFunction1_o3_n = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 19830 | |
| 19831 | /* ...... "PX2_EgoLaneNearPosValid" (48|2, standard signal, unsigned int, little endian) */ |
| 19832 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19833 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19834 | L4_MABX_B.SFunction1_o4_gq = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19835 | |
| 19836 | /* ...... "PX2_EgoLaneMidPosValid" (50|2, standard signal, unsigned int, little endian) */ |
| 19837 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19838 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 19839 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19840 | L4_MABX_B.SFunction1_o5_p = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19841 | |
| 19842 | /* ...... "PX2_EgoLaneFarPosValid" (52|2, standard signal, unsigned int, little endian) */ |
| 19843 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19844 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 19845 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19846 | L4_MABX_B.SFunction1_o6_g = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19847 | } |
| 19848 | } |
| 19849 | } else { |
| 19850 | /* set RX status to 0 because no new message has arrived */ |
| 19851 | L4_MABX_B.SFunction1_o7_l = 0.0; |
| 19852 | } |
| 19853 | } |
| 19854 | } |
| 19855 | |
| 19856 | /* End of Constant: '<S459>/Constant' */ |
| 19857 | /* End of Outputs for SubSystem: '<S642>/PX2_EgoLanePos' */ |
| 19858 | |
| 19859 | /* DataTypeConversion: '<S642>/Data Type Conversion10' */ |
| 19860 | L4_MABX_B.RX_delta_time_jag = L4_MABX_B.SFunction1_o9_c; |
| 19861 | |
| 19862 | /* DataTypeConversion: '<S642>/Data Type Conversion8' */ |
| 19863 | L4_MABX_B.RX_status_nv = (L4_MABX_B.SFunction1_o7_l != 0.0); |
| 19864 | |
| 19865 | /* DataTypeConversion: '<S642>/Data Type Conversion9' */ |
| 19866 | L4_MABX_B.RX_time_ad = L4_MABX_B.SFunction1_o8_n; |
| 19867 | |
| 19868 | /* DataTypeConversion: '<S644>/Data Type Conversion10' */ |
| 19869 | L4_MABX_B.RX_delta_time_at4 = L4_MABX_B.SFunction1_o7_e; |
| 19870 | |
| 19871 | /* DataTypeConversion: '<S644>/Data Type Conversion9' */ |
| 19872 | L4_MABX_B.RX_time_eh = L4_MABX_B.SFunction1_o6_k; |
| 19873 | |
| 19874 | /* DataTypeConversion: '<S646>/Data Type Conversion10' */ |
| 19875 | L4_MABX_B.RX_delta_time_b2 = L4_MABX_B.SFunction1_o28; |
| 19876 | |
| 19877 | /* DataTypeConversion: '<S646>/Data Type Conversion8' */ |
| 19878 | L4_MABX_B.RX_status_ku = (L4_MABX_B.SFunction1_o26 != 0.0); |
| 19879 | |
| 19880 | /* DataTypeConversion: '<S646>/Data Type Conversion9' */ |
| 19881 | L4_MABX_B.RX_time_jq = L4_MABX_B.SFunction1_o27; |
| 19882 | |
| 19883 | /* DataTypeConversion: '<S648>/Data Type Conversion10' */ |
| 19884 | L4_MABX_B.RX_delta_time_p = L4_MABX_B.SFunction1_o10; |
| 19885 | |
| 19886 | /* DataTypeConversion: '<S648>/Data Type Conversion8' */ |
| 19887 | L4_MABX_B.RX_status_nk = (L4_MABX_B.SFunction1_o8_m != 0.0); |
| 19888 | |
| 19889 | /* DataTypeConversion: '<S648>/Data Type Conversion9' */ |
| 19890 | L4_MABX_B.RX_time_gg = L4_MABX_B.SFunction1_o9_m; |
| 19891 | |
| 19892 | /* DataTypeConversion: '<S650>/Data Type Conversion10' */ |
| 19893 | L4_MABX_B.RX_delta_time_cz = L4_MABX_B.SFunction1_o9; |
| 19894 | |
| 19895 | /* DataTypeConversion: '<S650>/Data Type Conversion8' */ |
| 19896 | L4_MABX_B.RX_status_e3 = (L4_MABX_B.SFunction1_o7_f != 0.0); |
| 19897 | |
| 19898 | /* DataTypeConversion: '<S650>/Data Type Conversion9' */ |
| 19899 | L4_MABX_B.RX_time_er = L4_MABX_B.SFunction1_o8_p; |
| 19900 | |
| 19901 | /* Outputs for Enabled SubSystem: '<S652>/VEP1' incorporates: |
| 19902 | * EnablePort: '<S653>/Enable' |
| 19903 | */ |
| 19904 | /* Constant: '<S464>/Constant' */ |
| 19905 | if (L4_MABX_P.Constant_Value_jn > 0.0) { |
| 19906 | /* S-Function (rti_commonblock): '<S653>/S-Function1' */ |
| 19907 | /* This comment workarounds a code generation problem */ |
| 19908 | |
| 19909 | /* dSPACE RTICAN RX Message Block: "VEP1" Id:419362563 */ |
| 19910 | { |
| 19911 | UInt32 *CAN_Msg; |
| 19912 | static dsfloat time_old = 0.0; |
| 19913 | |
| 19914 | /* Read status and timestamp info (previous message) */ |
| 19915 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF703].timestamp != |
| 19916 | time_old) { |
| 19917 | /* ... save timestamp info for the calculation of the RX status |
| 19918 | during the consecutive sample hit*/ |
| 19919 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF703]. |
| 19920 | timestamp; |
| 19921 | |
| 19922 | /* ... set the processed flag to one */ |
| 19923 | L4_MABX_B.SFunction1_o6 = 1.0; |
| 19924 | L4_MABX_B.SFunction1_o7 = (real_T) |
| 19925 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF703].timestamp; |
| 19926 | L4_MABX_B.SFunction1_o8 = (real_T) |
| 19927 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF703].deltatime; |
| 19928 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF703].data; |
| 19929 | |
| 19930 | /* Decode CAN message */ |
| 19931 | { |
| 19932 | { |
| 19933 | rtican_Signal_t CAN_Sgn; |
| 19934 | |
| 19935 | /* ...... "NetBatteryCurrent" (0|8, standard signal, unsigned int, little endian) */ |
| 19936 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 19937 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 19938 | L4_MABX_B.SFunction1_o1_d = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 19939 | |
| 19940 | /* ...... "AltCurrent" (8|8, standard signal, unsigned int, little endian) */ |
| 19941 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 19942 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 19943 | L4_MABX_B.SFunction1_o2_lz = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19944 | |
| 19945 | /* ...... "ChargingSystemPotential" (16|16, standard signal, unsigned int, little endian) */ |
| 19946 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 19947 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 19948 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 19949 | L4_MABX_B.SFunction1_o3_j5 = 0.05 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 19950 | ); |
| 19951 | |
| 19952 | /* ...... "BatteryPotential_PowerInput1" (32|16, standard signal, unsigned int, little endian) */ |
| 19953 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 19954 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 19955 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 19956 | L4_MABX_B.SFunction1_o4_pz = 0.05 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 19957 | ); |
| 19958 | |
| 19959 | /* ...... "KeyswitchBatteryPotential" (48|16, standard signal, unsigned int, little endian) */ |
| 19960 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19961 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[7]; |
| 19962 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 19963 | L4_MABX_B.SFunction1_o5 = 0.05 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 19964 | } |
| 19965 | } |
| 19966 | } else { |
| 19967 | /* set RX status to 0 because no new message has arrived */ |
| 19968 | L4_MABX_B.SFunction1_o6 = 0.0; |
| 19969 | } |
| 19970 | } |
| 19971 | } |
| 19972 | |
| 19973 | /* End of Constant: '<S464>/Constant' */ |
| 19974 | /* End of Outputs for SubSystem: '<S652>/VEP1' */ |
| 19975 | |
| 19976 | /* DataTypeConversion: '<S652>/Data Type Conversion1' */ |
| 19977 | L4_MABX_B.PitchAngleExRange_j = L4_MABX_B.SFunction1_o1_d; |
| 19978 | |
| 19979 | /* DataTypeConversion: '<S652>/Data Type Conversion10' */ |
| 19980 | L4_MABX_B.RX_delta_time_l = L4_MABX_B.SFunction1_o8; |
| 19981 | |
| 19982 | /* DataTypeConversion: '<S652>/Data Type Conversion2' */ |
| 19983 | L4_MABX_B.AltCurrent = L4_MABX_B.SFunction1_o2_lz; |
| 19984 | |
| 19985 | /* DataTypeConversion: '<S652>/Data Type Conversion3' */ |
| 19986 | L4_MABX_B.ChargingSystemPotential = L4_MABX_B.SFunction1_o3_j5; |
| 19987 | |
| 19988 | /* DataTypeConversion: '<S652>/Data Type Conversion4' */ |
| 19989 | L4_MABX_B.BatteryPotential_PowerInput1 = L4_MABX_B.SFunction1_o4_pz; |
| 19990 | |
| 19991 | /* DataTypeConversion: '<S652>/Data Type Conversion5' */ |
| 19992 | L4_MABX_B.KeyswitchBatteryPotential = L4_MABX_B.SFunction1_o5; |
| 19993 | |
| 19994 | /* DataTypeConversion: '<S652>/Data Type Conversion8' */ |
| 19995 | L4_MABX_B.RX_status_kl = (L4_MABX_B.SFunction1_o6 != 0.0); |
| 19996 | |
| 19997 | /* DataTypeConversion: '<S652>/Data Type Conversion9' */ |
| 19998 | L4_MABX_B.RX_time_pz = L4_MABX_B.SFunction1_o7; |
| 19999 | |
| 20000 | /* RelationalOperator: '<S655>/Relational Operator2' incorporates: |
| 20001 | * Constant: '<S655>/TRUCK_166_VIN_CPV' |
| 20002 | */ |
| 20003 | L4_MABX_B.RelationalOperator2[0] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[0] != |
| 20004 | L4_MABX_B.DataTypeConversion_jo); |
| 20005 | L4_MABX_B.RelationalOperator2[1] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[1] != |
| 20006 | L4_MABX_B.DataTypeConversion1_aq); |
| 20007 | L4_MABX_B.RelationalOperator2[2] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[2] != |
| 20008 | L4_MABX_B.DataTypeConversion2_gd); |
| 20009 | L4_MABX_B.RelationalOperator2[3] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[3] != |
| 20010 | L4_MABX_B.DataTypeConversion3_g); |
| 20011 | L4_MABX_B.RelationalOperator2[4] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[4] != |
| 20012 | L4_MABX_B.DataTypeConversion4_g4); |
| 20013 | L4_MABX_B.RelationalOperator2[5] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[5] != |
| 20014 | L4_MABX_B.DataTypeConversion5_gv); |
| 20015 | L4_MABX_B.RelationalOperator2[6] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[6] != |
| 20016 | L4_MABX_B.DataTypeConversion6_e); |
| 20017 | L4_MABX_B.RelationalOperator2[7] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[7] != |
| 20018 | L4_MABX_B.DataTypeConversion7_m); |
| 20019 | L4_MABX_B.RelationalOperator2[8] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[8] != |
| 20020 | L4_MABX_B.DataTypeConversion8_aj); |
| 20021 | L4_MABX_B.RelationalOperator2[9] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[9] != |
| 20022 | L4_MABX_B.DataTypeConversion9_o); |
| 20023 | L4_MABX_B.RelationalOperator2[10] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[10] != |
| 20024 | L4_MABX_B.DataTypeConversion10_f5); |
| 20025 | L4_MABX_B.RelationalOperator2[11] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[11] != |
| 20026 | L4_MABX_B.DataTypeConversion11_a); |
| 20027 | L4_MABX_B.RelationalOperator2[12] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[12] != |
| 20028 | L4_MABX_B.DataTypeConversion12); |
| 20029 | L4_MABX_B.RelationalOperator2[13] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[13] != |
| 20030 | L4_MABX_B.DataTypeConversion14_k); |
| 20031 | L4_MABX_B.RelationalOperator2[14] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[14] != |
| 20032 | L4_MABX_B.DataTypeConversion13_h); |
| 20033 | L4_MABX_B.RelationalOperator2[15] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[15] != |
| 20034 | L4_MABX_B.DataTypeConversion15_o); |
| 20035 | L4_MABX_B.RelationalOperator2[16] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[16] != |
| 20036 | L4_MABX_B.DataTypeConversion16_o); |
| 20037 | |
| 20038 | /* Sum: '<S655>/Add1' */ |
| 20039 | tmp = 0U; |
| 20040 | for (i = 0; i < 17; i++) { |
| 20041 | tmp += L4_MABX_B.RelationalOperator2[i]; |
| 20042 | } |
| 20043 | |
| 20044 | L4_MABX_B.Add1_gi = (uint8_T)tmp; |
| 20045 | |
| 20046 | /* End of Sum: '<S655>/Add1' */ |
| 20047 | |
| 20048 | /* RelationalOperator: '<S660>/Compare' incorporates: |
| 20049 | * Constant: '<S660>/Constant' |
| 20050 | */ |
| 20051 | L4_MABX_B.Compare_ho = (L4_MABX_B.Add1_gi == L4_MABX_P.Constant_Value_ln); |
| 20052 | |
| 20053 | /* UnitDelay: '<S655>/Unit_Delay2' */ |
| 20054 | L4_MABX_B.Unit_Delay2_aa = L4_MABX_DW.Unit_Delay2_DSTATE_p1; |
| 20055 | |
| 20056 | /* Logic: '<S655>/Logical Operator1' */ |
| 20057 | L4_MABX_B.LogicalOperator1_k = (L4_MABX_B.Unit_Delay2_aa && |
| 20058 | L4_MABX_B.Compare_ho); |
| 20059 | |
| 20060 | /* Logic: '<S661>/Logical Operator2' */ |
| 20061 | L4_MABX_B.LogicalOperator2_j = !L4_MABX_B.LogicalOperator1_c; |
| 20062 | |
| 20063 | /* UnitDelay: '<S655>/Unit_Delay1' */ |
| 20064 | L4_MABX_B.Unit_Delay1_p = L4_MABX_DW.Unit_Delay1_DSTATE_d; |
| 20065 | |
| 20066 | /* Logic: '<S662>/Logical Operator3' */ |
| 20067 | L4_MABX_B.LogicalOperator3_j = !L4_MABX_B.Unit_Delay1_p; |
| 20068 | |
| 20069 | /* UnitDelay: '<S662>/Unit_Delay' */ |
| 20070 | L4_MABX_B.Unit_Delay_nw = L4_MABX_DW.Unit_Delay_DSTATE_iv; |
| 20071 | |
| 20072 | /* Logic: '<S662>/Logical Operator' */ |
| 20073 | L4_MABX_B.LogicalOperator_id = (L4_MABX_B.LogicalOperator3_j && |
| 20074 | L4_MABX_B.Unit_Delay_nw); |
| 20075 | |
| 20076 | /* Logic: '<S662>/Logical Operator1' */ |
| 20077 | L4_MABX_B.LogicalOperator1_cl = (L4_MABX_B.LogicalOperator1_k || |
| 20078 | L4_MABX_B.LogicalOperator_id); |
| 20079 | |
| 20080 | /* Logic: '<S662>/Logical Operator2' */ |
| 20081 | L4_MABX_B.LogicalOperator2_a = !L4_MABX_B.LogicalOperator1_cl; |
| 20082 | |
| 20083 | /* Constant: '<S421>/Constant2' */ |
| 20084 | L4_MABX_B.PX2_HeartBeat = L4_MABX_P.Constant2_Value_i1; |
| 20085 | |
| 20086 | /* RelationalOperator: '<S699>/Operator' incorporates: |
| 20087 | * Constant: '<S475>/Constant1' |
| 20088 | */ |
| 20089 | L4_MABX_B.Operator_fb = (L4_MABX_B.DataTypeConversion_j2[0] == |
| 20090 | L4_MABX_P.Constant1_Value_dt); |
| 20091 | |
| 20092 | /* Outputs for Enabled SubSystem: '<S475>/Decode_TPCM_CTS' incorporates: |
| 20093 | * EnablePort: '<S694>/Enable' |
| 20094 | */ |
| 20095 | if (L4_MABX_B.Operator_fb) { |
| 20096 | /* SignalConversion: '<S711>/Signal Conversion' */ |
| 20097 | L4_MABX_B.SPN2556_ControlByte_k = L4_MABX_B.DataTypeConversion_j2[0]; |
| 20098 | |
| 20099 | /* SignalConversion: '<S712>/Signal Conversion' */ |
| 20100 | L4_MABX_B.SPN2561_NumberOfPacketsThatCanB = L4_MABX_B.DataTypeConversion_j2 |
| 20101 | [1]; |
| 20102 | |
| 20103 | /* SignalConversion: '<S713>/Signal Conversion' */ |
| 20104 | L4_MABX_B.SPN2562_NextPacketNumberToBeSen = L4_MABX_B.DataTypeConversion_j2 |
| 20105 | [2]; |
| 20106 | |
| 20107 | /* DataTypeConversion: '<S714>/Data Type Conversion' */ |
| 20108 | L4_MABX_B.DataTypeConversion_is = L4_MABX_B.DataTypeConversion_j2[5]; |
| 20109 | |
| 20110 | /* DataTypeConversion: '<S714>/Data Type Conversion1' */ |
| 20111 | L4_MABX_B.DataTypeConversion1_mi = L4_MABX_B.DataTypeConversion_j2[6]; |
| 20112 | |
| 20113 | /* DataTypeConversion: '<S714>/Data Type Conversion2' */ |
| 20114 | L4_MABX_B.DataTypeConversion2_pj = L4_MABX_B.DataTypeConversion_j2[7]; |
| 20115 | |
| 20116 | /* ArithShift: '<S714>/Shift Arithmetic1' */ |
| 20117 | L4_MABX_B.ShiftArithmetic1_l = L4_MABX_B.DataTypeConversion1_mi << 8; |
| 20118 | |
| 20119 | /* ArithShift: '<S714>/Shift Arithmetic2' */ |
| 20120 | L4_MABX_B.ShiftArithmetic2_l = L4_MABX_B.DataTypeConversion2_pj << 16; |
| 20121 | |
| 20122 | /* S-Function (sfix_bitop): '<S715>/Operator' */ |
| 20123 | L4_MABX_B.Operator_g = L4_MABX_B.DataTypeConversion_is | |
| 20124 | L4_MABX_B.ShiftArithmetic1_l | L4_MABX_B.ShiftArithmetic2_l; |
| 20125 | |
| 20126 | /* DataTypeConversion: '<S715>/DataType' */ |
| 20127 | L4_MABX_B.DataType_b1 = L4_MABX_B.Operator_g; |
| 20128 | } |
| 20129 | |
| 20130 | /* End of Outputs for SubSystem: '<S475>/Decode_TPCM_CTS' */ |
| 20131 | |
| 20132 | /* RelationalOperator: '<S702>/Operator' incorporates: |
| 20133 | * Constant: '<S475>/Constant4' |
| 20134 | */ |
| 20135 | L4_MABX_B.Operator_jd = (L4_MABX_B.DataTypeConversion_j2[0] == |
| 20136 | L4_MABX_P.Constant4_Value_cy); |
| 20137 | |
| 20138 | /* Outputs for Enabled SubSystem: '<S475>/Decode_TPCM_ConnectionAbort' incorporates: |
| 20139 | * EnablePort: '<S695>/Enable' |
| 20140 | */ |
| 20141 | if (L4_MABX_B.Operator_jd) { |
| 20142 | /* SignalConversion: '<S717>/Signal Conversion' */ |
| 20143 | L4_MABX_B.SPN2556_ControlByte_g = L4_MABX_B.DataTypeConversion_j2[0]; |
| 20144 | |
| 20145 | /* SignalConversion: '<S718>/Signal Conversion' */ |
| 20146 | L4_MABX_B.SPN2570_ConnectionAbortReason = L4_MABX_B.DataTypeConversion_j2[1]; |
| 20147 | |
| 20148 | /* DataTypeConversion: '<S719>/Data Type Conversion' */ |
| 20149 | L4_MABX_B.DataTypeConversion_bl = L4_MABX_B.DataTypeConversion_j2[5]; |
| 20150 | |
| 20151 | /* DataTypeConversion: '<S719>/Data Type Conversion1' */ |
| 20152 | L4_MABX_B.DataTypeConversion1_fh = L4_MABX_B.DataTypeConversion_j2[6]; |
| 20153 | |
| 20154 | /* DataTypeConversion: '<S719>/Data Type Conversion2' */ |
| 20155 | L4_MABX_B.DataTypeConversion2_gp = L4_MABX_B.DataTypeConversion_j2[7]; |
| 20156 | |
| 20157 | /* ArithShift: '<S719>/Shift Arithmetic1' */ |
| 20158 | L4_MABX_B.ShiftArithmetic1_fc = L4_MABX_B.DataTypeConversion1_fh << 8; |
| 20159 | |
| 20160 | /* ArithShift: '<S719>/Shift Arithmetic2' */ |
| 20161 | L4_MABX_B.ShiftArithmetic2_m = L4_MABX_B.DataTypeConversion2_gp << 16; |
| 20162 | |
| 20163 | /* S-Function (sfix_bitop): '<S720>/Operator' */ |
| 20164 | L4_MABX_B.Operator_il = L4_MABX_B.DataTypeConversion_bl | |
| 20165 | L4_MABX_B.ShiftArithmetic1_fc | L4_MABX_B.ShiftArithmetic2_m; |
| 20166 | |
| 20167 | /* DataTypeConversion: '<S720>/DataType' */ |
| 20168 | L4_MABX_B.DataType_pd = L4_MABX_B.Operator_il; |
| 20169 | } |
| 20170 | |
| 20171 | /* End of Outputs for SubSystem: '<S475>/Decode_TPCM_ConnectionAbort' */ |
| 20172 | |
| 20173 | /* RelationalOperator: '<S700>/Operator' incorporates: |
| 20174 | * Constant: '<S475>/Constant2' |
| 20175 | */ |
| 20176 | L4_MABX_B.Operator_hh = (L4_MABX_B.DataTypeConversion_j2[0] == |
| 20177 | L4_MABX_P.Constant2_Value_j5); |
| 20178 | |
| 20179 | /* Outputs for Enabled SubSystem: '<S475>/Decode_TPCM_EndOfMessageAck' incorporates: |
| 20180 | * EnablePort: '<S696>/Enable' |
| 20181 | */ |
| 20182 | if (L4_MABX_B.Operator_hh) { |
| 20183 | /* SignalConversion: '<S722>/Signal Conversion' */ |
| 20184 | L4_MABX_B.SPN2556_ControlByte_i = L4_MABX_B.DataTypeConversion_j2[0]; |
| 20185 | |
| 20186 | /* DataTypeConversion: '<S723>/Data Type Conversion' */ |
| 20187 | L4_MABX_B.DataTypeConversion_f = L4_MABX_B.DataTypeConversion_j2[1]; |
| 20188 | |
| 20189 | /* DataTypeConversion: '<S723>/Data Type Conversion1' */ |
| 20190 | L4_MABX_B.DataTypeConversion1_nk = L4_MABX_B.DataTypeConversion_j2[2]; |
| 20191 | |
| 20192 | /* ArithShift: '<S723>/Shift Arithmetic2' */ |
| 20193 | L4_MABX_B.ShiftArithmetic2_a = (uint16_T)(L4_MABX_B.DataTypeConversion1_nk << |
| 20194 | 8); |
| 20195 | |
| 20196 | /* S-Function (sfix_bitop): '<S726>/Operator' */ |
| 20197 | L4_MABX_B.Operator_br = (uint16_T)(L4_MABX_B.DataTypeConversion_f | |
| 20198 | L4_MABX_B.ShiftArithmetic2_a); |
| 20199 | |
| 20200 | /* DataTypeConversion: '<S726>/DataType' */ |
| 20201 | L4_MABX_B.DataType_ilc = L4_MABX_B.Operator_br; |
| 20202 | |
| 20203 | /* SignalConversion: '<S724>/Signal Conversion' */ |
| 20204 | L4_MABX_B.SPN2565_TotalNumberOfPackets = L4_MABX_B.DataTypeConversion_j2[3]; |
| 20205 | |
| 20206 | /* DataTypeConversion: '<S725>/Data Type Conversion' */ |
| 20207 | L4_MABX_B.DataTypeConversion_kt = L4_MABX_B.DataTypeConversion_j2[5]; |
| 20208 | |
| 20209 | /* DataTypeConversion: '<S725>/Data Type Conversion1' */ |
| 20210 | L4_MABX_B.DataTypeConversion1_oh = L4_MABX_B.DataTypeConversion_j2[6]; |
| 20211 | |
| 20212 | /* DataTypeConversion: '<S725>/Data Type Conversion2' */ |
| 20213 | L4_MABX_B.DataTypeConversion2_mi = L4_MABX_B.DataTypeConversion_j2[7]; |
| 20214 | |
| 20215 | /* ArithShift: '<S725>/Shift Arithmetic1' */ |
| 20216 | L4_MABX_B.ShiftArithmetic1_f = L4_MABX_B.DataTypeConversion1_oh << 8; |
| 20217 | |
| 20218 | /* ArithShift: '<S725>/Shift Arithmetic2' */ |
| 20219 | L4_MABX_B.ShiftArithmetic2_g = L4_MABX_B.DataTypeConversion2_mi << 16; |
| 20220 | |
| 20221 | /* S-Function (sfix_bitop): '<S727>/Operator' */ |
| 20222 | L4_MABX_B.Operator_e2 = L4_MABX_B.DataTypeConversion_kt | |
| 20223 | L4_MABX_B.ShiftArithmetic1_f | L4_MABX_B.ShiftArithmetic2_g; |
| 20224 | |
| 20225 | /* DataTypeConversion: '<S727>/DataType' */ |
| 20226 | L4_MABX_B.DataType_m2 = L4_MABX_B.Operator_e2; |
| 20227 | } |
| 20228 | |
| 20229 | /* End of Outputs for SubSystem: '<S475>/Decode_TPCM_EndOfMessageAck' */ |
| 20230 | |
| 20231 | /* RelationalOperator: '<S698>/Operator' incorporates: |
| 20232 | * Constant: '<S475>/Constant' |
| 20233 | */ |
| 20234 | L4_MABX_B.Operator_eu = (L4_MABX_B.DataTypeConversion_j2[0] == |
| 20235 | L4_MABX_P.Constant_Value_hv); |
| 20236 | |
| 20237 | /* Outputs for Enabled SubSystem: '<S475>/Decode_TPCM_RTS' incorporates: |
| 20238 | * EnablePort: '<S697>/Enable' |
| 20239 | */ |
| 20240 | if (L4_MABX_B.Operator_eu) { |
| 20241 | /* SignalConversion: '<S729>/Signal Conversion' */ |
| 20242 | L4_MABX_B.SPN2556_ControlByte = L4_MABX_B.DataTypeConversion_j2[0]; |
| 20243 | |
| 20244 | /* DataTypeConversion: '<S730>/Data Type Conversion' */ |
| 20245 | L4_MABX_B.DataTypeConversion_eu = L4_MABX_B.DataTypeConversion_j2[1]; |
| 20246 | |
| 20247 | /* DataTypeConversion: '<S730>/Data Type Conversion1' */ |
| 20248 | L4_MABX_B.DataTypeConversion1_jf = L4_MABX_B.DataTypeConversion_j2[2]; |
| 20249 | |
| 20250 | /* ArithShift: '<S730>/Shift Arithmetic2' */ |
| 20251 | L4_MABX_B.ShiftArithmetic2_i = (uint16_T)(L4_MABX_B.DataTypeConversion1_jf << |
| 20252 | 8); |
| 20253 | |
| 20254 | /* S-Function (sfix_bitop): '<S734>/Operator' */ |
| 20255 | L4_MABX_B.Operator_kf = (uint16_T)(L4_MABX_B.DataTypeConversion_eu | |
| 20256 | L4_MABX_B.ShiftArithmetic2_i); |
| 20257 | |
| 20258 | /* DataTypeConversion: '<S734>/DataType' */ |
| 20259 | L4_MABX_B.DataType_fn = L4_MABX_B.Operator_kf; |
| 20260 | |
| 20261 | /* SignalConversion: '<S731>/Signal Conversion' */ |
| 20262 | L4_MABX_B.SPN2558_TotalNumberOfPackets = L4_MABX_B.DataTypeConversion_j2[3]; |
| 20263 | |
| 20264 | /* SignalConversion: '<S732>/Signal Conversion' */ |
| 20265 | L4_MABX_B.SPN2559_MaximumNumberOfPackets = L4_MABX_B.DataTypeConversion_j2[4]; |
| 20266 | |
| 20267 | /* DataTypeConversion: '<S733>/Data Type Conversion' */ |
| 20268 | L4_MABX_B.DataTypeConversion_p4 = L4_MABX_B.DataTypeConversion_j2[5]; |
| 20269 | |
| 20270 | /* DataTypeConversion: '<S733>/Data Type Conversion1' */ |
| 20271 | L4_MABX_B.DataTypeConversion1_c = L4_MABX_B.DataTypeConversion_j2[6]; |
| 20272 | |
| 20273 | /* DataTypeConversion: '<S733>/Data Type Conversion2' */ |
| 20274 | L4_MABX_B.DataTypeConversion2_h1 = L4_MABX_B.DataTypeConversion_j2[7]; |
| 20275 | |
| 20276 | /* ArithShift: '<S733>/Shift Arithmetic1' */ |
| 20277 | L4_MABX_B.ShiftArithmetic1 = L4_MABX_B.DataTypeConversion1_c << 8; |
| 20278 | |
| 20279 | /* ArithShift: '<S733>/Shift Arithmetic2' */ |
| 20280 | L4_MABX_B.ShiftArithmetic2 = L4_MABX_B.DataTypeConversion2_h1 << 16; |
| 20281 | |
| 20282 | /* S-Function (sfix_bitop): '<S735>/Operator' */ |
| 20283 | L4_MABX_B.Operator_nr = L4_MABX_B.DataTypeConversion_p4 | |
| 20284 | L4_MABX_B.ShiftArithmetic1 | L4_MABX_B.ShiftArithmetic2; |
| 20285 | |
| 20286 | /* DataTypeConversion: '<S735>/DataType' */ |
| 20287 | L4_MABX_B.DataType_ke = L4_MABX_B.Operator_nr; |
| 20288 | } |
| 20289 | |
| 20290 | /* End of Outputs for SubSystem: '<S475>/Decode_TPCM_RTS' */ |
| 20291 | |
| 20292 | /* RelationalOperator: '<S595>/Operator' incorporates: |
| 20293 | * Constant: '<S450>/Constant' |
| 20294 | * Constant: '<S591>/Constant' |
| 20295 | */ |
| 20296 | L4_MABX_B.Operator_kmo = (PROPB_REAX_CHANNEL_APV == |
| 20297 | L4_MABX_P.Constant_Value_b4); |
| 20298 | |
| 20299 | /* Outputs for Enabled SubSystem: '<S588>/CAN_TYPE1_RX_M1_C1' incorporates: |
| 20300 | * EnablePort: '<S592>/Enable' |
| 20301 | */ |
| 20302 | if (L4_MABX_B.Operator_kmo) { |
| 20303 | /* S-Function (rti_commonblock): '<S592>/S-Function1' */ |
| 20304 | /* This comment workarounds a code generation problem */ |
| 20305 | |
| 20306 | /* dSPACE RTICAN RX Message Block: "PropB_REAX_3_13" Id:419426579 */ |
| 20307 | { |
| 20308 | UInt32 *CAN_Msg; |
| 20309 | static dsfloat time_old = 0.0; |
| 20310 | |
| 20311 | /* Read status and timestamp info (previous message) */ |
| 20312 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF113].timestamp != |
| 20313 | time_old) { |
| 20314 | /* ... save timestamp info for the calculation of the RX status |
| 20315 | during the consecutive sample hit*/ |
| 20316 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF113]. |
| 20317 | timestamp; |
| 20318 | |
| 20319 | /* ... set the processed flag to one */ |
| 20320 | L4_MABX_B.SFunction1_o9_i4 = 1.0; |
| 20321 | L4_MABX_B.SFunction1_o10_hc = (real_T) |
| 20322 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF113].timestamp; |
| 20323 | L4_MABX_B.SFunction1_o11_n = (real_T) |
| 20324 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF113].deltatime; |
| 20325 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF113].data; |
| 20326 | |
| 20327 | /* Decode CAN message */ |
| 20328 | { |
| 20329 | { |
| 20330 | rtican_Signal_t CAN_Sgn; |
| 20331 | |
| 20332 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 20333 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 20334 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20335 | L4_MABX_B.SFunction1_o1_f0 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20336 | |
| 20337 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 20338 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 20339 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20340 | L4_MABX_B.SFunction1_o2_pl = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20341 | |
| 20342 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 20343 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 20344 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20345 | L4_MABX_B.SFunction1_o3_pe = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20346 | |
| 20347 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 20348 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 20349 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20350 | L4_MABX_B.SFunction1_o4_h2 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20351 | |
| 20352 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 20353 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 20354 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20355 | L4_MABX_B.SFunction1_o5_m0 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20356 | |
| 20357 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 20358 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 20359 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20360 | L4_MABX_B.SFunction1_o6_b1 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20361 | |
| 20362 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 20363 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 20364 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20365 | L4_MABX_B.SFunction1_o7_al = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20366 | |
| 20367 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 20368 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 20369 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20370 | L4_MABX_B.SFunction1_o8_ar = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20371 | } |
| 20372 | } |
| 20373 | } else { |
| 20374 | /* set RX status to 0 because no new message has arrived */ |
| 20375 | L4_MABX_B.SFunction1_o9_i4 = 0.0; |
| 20376 | } |
| 20377 | } |
| 20378 | } |
| 20379 | |
| 20380 | /* End of Outputs for SubSystem: '<S588>/CAN_TYPE1_RX_M1_C1' */ |
| 20381 | |
| 20382 | /* RelationalOperator: '<S596>/Operator' incorporates: |
| 20383 | * Constant: '<S450>/Constant' |
| 20384 | * Constant: '<S591>/Constant1' |
| 20385 | */ |
| 20386 | L4_MABX_B.Operator_ef = (PROPB_REAX_CHANNEL_APV == |
| 20387 | L4_MABX_P.Constant1_Value_a3); |
| 20388 | |
| 20389 | /* Outputs for Enabled SubSystem: '<S589>/CAN_TYPE1_RX_M1_C2' incorporates: |
| 20390 | * EnablePort: '<S593>/Enable' |
| 20391 | */ |
| 20392 | if (L4_MABX_B.Operator_ef) { |
| 20393 | /* S-Function (rti_commonblock): '<S593>/S-Function1' */ |
| 20394 | /* This comment workarounds a code generation problem */ |
| 20395 | |
| 20396 | /* dSPACE RTICAN RX Message Block: "PropB_REAX_3_13" Id:419426579 */ |
| 20397 | { |
| 20398 | UInt32 *CAN_Msg; |
| 20399 | static dsfloat time_old = 0.0; |
| 20400 | |
| 20401 | /* Read status and timestamp info (previous message) */ |
| 20402 | if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF113].timestamp != |
| 20403 | time_old) { |
| 20404 | /* ... save timestamp info for the calculation of the RX status |
| 20405 | during the consecutive sample hit*/ |
| 20406 | time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF113]. |
| 20407 | timestamp; |
| 20408 | |
| 20409 | /* ... set the processed flag to one */ |
| 20410 | L4_MABX_B.SFunction1_o9_jm = 1.0; |
| 20411 | L4_MABX_B.SFunction1_o10_o = (real_T) |
| 20412 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF113].timestamp; |
| 20413 | L4_MABX_B.SFunction1_o11_fl = (real_T) |
| 20414 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF113].deltatime; |
| 20415 | CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF113].data; |
| 20416 | |
| 20417 | /* Decode CAN message */ |
| 20418 | { |
| 20419 | { |
| 20420 | rtican_Signal_t CAN_Sgn; |
| 20421 | |
| 20422 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 20423 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 20424 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20425 | L4_MABX_B.SFunction1_o1_np = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20426 | |
| 20427 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 20428 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 20429 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20430 | L4_MABX_B.SFunction1_o2_bp = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20431 | |
| 20432 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 20433 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 20434 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20435 | L4_MABX_B.SFunction1_o3_cq = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20436 | |
| 20437 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 20438 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 20439 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20440 | L4_MABX_B.SFunction1_o4_ph = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20441 | |
| 20442 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 20443 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 20444 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20445 | L4_MABX_B.SFunction1_o5_iy = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20446 | |
| 20447 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 20448 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 20449 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20450 | L4_MABX_B.SFunction1_o6_g4 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20451 | |
| 20452 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 20453 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 20454 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20455 | L4_MABX_B.SFunction1_o7_ea = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20456 | |
| 20457 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 20458 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 20459 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20460 | L4_MABX_B.SFunction1_o8_c = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20461 | } |
| 20462 | } |
| 20463 | } else { |
| 20464 | /* set RX status to 0 because no new message has arrived */ |
| 20465 | L4_MABX_B.SFunction1_o9_jm = 0.0; |
| 20466 | } |
| 20467 | } |
| 20468 | } |
| 20469 | |
| 20470 | /* End of Outputs for SubSystem: '<S589>/CAN_TYPE1_RX_M1_C2' */ |
| 20471 | |
| 20472 | /* DataTypeConversion: '<S589>/Data Type Conversion' */ |
| 20473 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_np; |
| 20474 | if (PositionFinalLimited < 256.0) { |
| 20475 | if (PositionFinalLimited >= 0.0) { |
| 20476 | starting_index = (uint8_T)PositionFinalLimited; |
| 20477 | } else { |
| 20478 | starting_index = 0U; |
| 20479 | } |
| 20480 | } else { |
| 20481 | starting_index = MAX_uint8_T; |
| 20482 | } |
| 20483 | |
| 20484 | L4_MABX_B.DataTypeConversion_h1 = starting_index; |
| 20485 | |
| 20486 | /* End of DataTypeConversion: '<S589>/Data Type Conversion' */ |
| 20487 | |
| 20488 | /* DataTypeConversion: '<S589>/Data Type Conversion1' */ |
| 20489 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_bp; |
| 20490 | if (PositionFinalLimited < 256.0) { |
| 20491 | if (PositionFinalLimited >= 0.0) { |
| 20492 | starting_index = (uint8_T)PositionFinalLimited; |
| 20493 | } else { |
| 20494 | starting_index = 0U; |
| 20495 | } |
| 20496 | } else { |
| 20497 | starting_index = MAX_uint8_T; |
| 20498 | } |
| 20499 | |
| 20500 | L4_MABX_B.DataTypeConversion1_lj = starting_index; |
| 20501 | |
| 20502 | /* End of DataTypeConversion: '<S589>/Data Type Conversion1' */ |
| 20503 | |
| 20504 | /* DataTypeConversion: '<S589>/Data Type Conversion2' */ |
| 20505 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_cq; |
| 20506 | if (PositionFinalLimited < 256.0) { |
| 20507 | if (PositionFinalLimited >= 0.0) { |
| 20508 | starting_index = (uint8_T)PositionFinalLimited; |
| 20509 | } else { |
| 20510 | starting_index = 0U; |
| 20511 | } |
| 20512 | } else { |
| 20513 | starting_index = MAX_uint8_T; |
| 20514 | } |
| 20515 | |
| 20516 | L4_MABX_B.DataTypeConversion2_j = starting_index; |
| 20517 | |
| 20518 | /* End of DataTypeConversion: '<S589>/Data Type Conversion2' */ |
| 20519 | |
| 20520 | /* DataTypeConversion: '<S589>/Data Type Conversion3' */ |
| 20521 | PositionFinalLimited = L4_MABX_B.SFunction1_o4_ph; |
| 20522 | if (PositionFinalLimited < 256.0) { |
| 20523 | if (PositionFinalLimited >= 0.0) { |
| 20524 | starting_index = (uint8_T)PositionFinalLimited; |
| 20525 | } else { |
| 20526 | starting_index = 0U; |
| 20527 | } |
| 20528 | } else { |
| 20529 | starting_index = MAX_uint8_T; |
| 20530 | } |
| 20531 | |
| 20532 | L4_MABX_B.DataTypeConversion3_gc = starting_index; |
| 20533 | |
| 20534 | /* End of DataTypeConversion: '<S589>/Data Type Conversion3' */ |
| 20535 | |
| 20536 | /* DataTypeConversion: '<S589>/Data Type Conversion4' */ |
| 20537 | PositionFinalLimited = L4_MABX_B.SFunction1_o5_iy; |
| 20538 | if (PositionFinalLimited < 256.0) { |
| 20539 | if (PositionFinalLimited >= 0.0) { |
| 20540 | starting_index = (uint8_T)PositionFinalLimited; |
| 20541 | } else { |
| 20542 | starting_index = 0U; |
| 20543 | } |
| 20544 | } else { |
| 20545 | starting_index = MAX_uint8_T; |
| 20546 | } |
| 20547 | |
| 20548 | L4_MABX_B.DataTypeConversion4_ec = starting_index; |
| 20549 | |
| 20550 | /* End of DataTypeConversion: '<S589>/Data Type Conversion4' */ |
| 20551 | |
| 20552 | /* DataTypeConversion: '<S589>/Data Type Conversion5' */ |
| 20553 | PositionFinalLimited = L4_MABX_B.SFunction1_o6_g4; |
| 20554 | if (PositionFinalLimited < 256.0) { |
| 20555 | if (PositionFinalLimited >= 0.0) { |
| 20556 | starting_index = (uint8_T)PositionFinalLimited; |
| 20557 | } else { |
| 20558 | starting_index = 0U; |
| 20559 | } |
| 20560 | } else { |
| 20561 | starting_index = MAX_uint8_T; |
| 20562 | } |
| 20563 | |
| 20564 | L4_MABX_B.DataTypeConversion5_b = starting_index; |
| 20565 | |
| 20566 | /* End of DataTypeConversion: '<S589>/Data Type Conversion5' */ |
| 20567 | |
| 20568 | /* DataTypeConversion: '<S589>/Data Type Conversion6' */ |
| 20569 | PositionFinalLimited = L4_MABX_B.SFunction1_o7_ea; |
| 20570 | if (PositionFinalLimited < 256.0) { |
| 20571 | if (PositionFinalLimited >= 0.0) { |
| 20572 | starting_index = (uint8_T)PositionFinalLimited; |
| 20573 | } else { |
| 20574 | starting_index = 0U; |
| 20575 | } |
| 20576 | } else { |
| 20577 | starting_index = MAX_uint8_T; |
| 20578 | } |
| 20579 | |
| 20580 | L4_MABX_B.DataTypeConversion6_g = starting_index; |
| 20581 | |
| 20582 | /* End of DataTypeConversion: '<S589>/Data Type Conversion6' */ |
| 20583 | |
| 20584 | /* DataTypeConversion: '<S589>/Data Type Conversion7' */ |
| 20585 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_c; |
| 20586 | if (PositionFinalLimited < 256.0) { |
| 20587 | if (PositionFinalLimited >= 0.0) { |
| 20588 | starting_index = (uint8_T)PositionFinalLimited; |
| 20589 | } else { |
| 20590 | starting_index = 0U; |
| 20591 | } |
| 20592 | } else { |
| 20593 | starting_index = MAX_uint8_T; |
| 20594 | } |
| 20595 | |
| 20596 | L4_MABX_B.DataTypeConversion7_ic = starting_index; |
| 20597 | |
| 20598 | /* End of DataTypeConversion: '<S589>/Data Type Conversion7' */ |
| 20599 | |
| 20600 | /* RelationalOperator: '<S600>/Operator' incorporates: |
| 20601 | * Constant: '<S450>/Constant' |
| 20602 | * Constant: '<S591>/Constant5' |
| 20603 | */ |
| 20604 | L4_MABX_B.Operator_fhg = (PROPB_REAX_CHANNEL_APV == |
| 20605 | L4_MABX_P.Constant5_Value_n); |
| 20606 | |
| 20607 | /* Outputs for Enabled SubSystem: '<S590>/CAN_TYPE1_RX_M3_C2' incorporates: |
| 20608 | * EnablePort: '<S594>/Enable' |
| 20609 | */ |
| 20610 | if (L4_MABX_B.Operator_fhg) { |
| 20611 | /* S-Function (rti_commonblock): '<S594>/S-Function1' */ |
| 20612 | /* This comment workarounds a code generation problem */ |
| 20613 | |
| 20614 | /* dSPACE RTICAN RX Message Block: "PropB_REAX_3_13" Id:486535443 */ |
| 20615 | { |
| 20616 | UInt32 *CAN_Msg; |
| 20617 | static dsfloat time_old = 0.0; |
| 20618 | |
| 20619 | /* Read status and timestamp info (previous message) */ |
| 20620 | if (can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF113].timestamp != |
| 20621 | time_old) { |
| 20622 | /* ... save timestamp info for the calculation of the RX status |
| 20623 | during the consecutive sample hit*/ |
| 20624 | time_old = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF113]. |
| 20625 | timestamp; |
| 20626 | |
| 20627 | /* ... set the processed flag to one */ |
| 20628 | L4_MABX_B.SFunction1_o9_kq = 1.0; |
| 20629 | L4_MABX_B.SFunction1_o10_f = (real_T) |
| 20630 | can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF113].timestamp; |
| 20631 | L4_MABX_B.SFunction1_o11_o = (real_T) |
| 20632 | can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF113].deltatime; |
| 20633 | CAN_Msg = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF113].data; |
| 20634 | |
| 20635 | /* Decode CAN message */ |
| 20636 | { |
| 20637 | { |
| 20638 | rtican_Signal_t CAN_Sgn; |
| 20639 | |
| 20640 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 20641 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 20642 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20643 | L4_MABX_B.SFunction1_o1_ae = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20644 | |
| 20645 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 20646 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 20647 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20648 | L4_MABX_B.SFunction1_o2_nt = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20649 | |
| 20650 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 20651 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 20652 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20653 | L4_MABX_B.SFunction1_o3_ng = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20654 | |
| 20655 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 20656 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 20657 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20658 | L4_MABX_B.SFunction1_o4_okw = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20659 | |
| 20660 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 20661 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 20662 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20663 | L4_MABX_B.SFunction1_o5_l = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20664 | |
| 20665 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 20666 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 20667 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20668 | L4_MABX_B.SFunction1_o6_nq = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20669 | |
| 20670 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 20671 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 20672 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20673 | L4_MABX_B.SFunction1_o7_lb = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20674 | |
| 20675 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 20676 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 20677 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20678 | L4_MABX_B.SFunction1_o8_bi = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20679 | } |
| 20680 | } |
| 20681 | } else { |
| 20682 | /* set RX status to 0 because no new message has arrived */ |
| 20683 | L4_MABX_B.SFunction1_o9_kq = 0.0; |
| 20684 | } |
| 20685 | } |
| 20686 | } |
| 20687 | |
| 20688 | /* End of Outputs for SubSystem: '<S590>/CAN_TYPE1_RX_M3_C2' */ |
| 20689 | |
| 20690 | /* DataTypeConversion: '<S590>/Data Type Conversion' */ |
| 20691 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_ae; |
| 20692 | if (PositionFinalLimited < 256.0) { |
| 20693 | if (PositionFinalLimited >= 0.0) { |
| 20694 | starting_index = (uint8_T)PositionFinalLimited; |
| 20695 | } else { |
| 20696 | starting_index = 0U; |
| 20697 | } |
| 20698 | } else { |
| 20699 | starting_index = MAX_uint8_T; |
| 20700 | } |
| 20701 | |
| 20702 | L4_MABX_B.DataTypeConversion_ld = starting_index; |
| 20703 | |
| 20704 | /* End of DataTypeConversion: '<S590>/Data Type Conversion' */ |
| 20705 | |
| 20706 | /* DataTypeConversion: '<S590>/Data Type Conversion1' */ |
| 20707 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_nt; |
| 20708 | if (PositionFinalLimited < 256.0) { |
| 20709 | if (PositionFinalLimited >= 0.0) { |
| 20710 | starting_index = (uint8_T)PositionFinalLimited; |
| 20711 | } else { |
| 20712 | starting_index = 0U; |
| 20713 | } |
| 20714 | } else { |
| 20715 | starting_index = MAX_uint8_T; |
| 20716 | } |
| 20717 | |
| 20718 | L4_MABX_B.DataTypeConversion1_j1 = starting_index; |
| 20719 | |
| 20720 | /* End of DataTypeConversion: '<S590>/Data Type Conversion1' */ |
| 20721 | |
| 20722 | /* DataTypeConversion: '<S590>/Data Type Conversion2' */ |
| 20723 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_ng; |
| 20724 | if (PositionFinalLimited < 256.0) { |
| 20725 | if (PositionFinalLimited >= 0.0) { |
| 20726 | starting_index = (uint8_T)PositionFinalLimited; |
| 20727 | } else { |
| 20728 | starting_index = 0U; |
| 20729 | } |
| 20730 | } else { |
| 20731 | starting_index = MAX_uint8_T; |
| 20732 | } |
| 20733 | |
| 20734 | L4_MABX_B.DataTypeConversion2_el = starting_index; |
| 20735 | |
| 20736 | /* End of DataTypeConversion: '<S590>/Data Type Conversion2' */ |
| 20737 | |
| 20738 | /* DataTypeConversion: '<S590>/Data Type Conversion3' */ |
| 20739 | PositionFinalLimited = L4_MABX_B.SFunction1_o4_okw; |
| 20740 | if (PositionFinalLimited < 256.0) { |
| 20741 | if (PositionFinalLimited >= 0.0) { |
| 20742 | starting_index = (uint8_T)PositionFinalLimited; |
| 20743 | } else { |
| 20744 | starting_index = 0U; |
| 20745 | } |
| 20746 | } else { |
| 20747 | starting_index = MAX_uint8_T; |
| 20748 | } |
| 20749 | |
| 20750 | L4_MABX_B.DataTypeConversion3_em = starting_index; |
| 20751 | |
| 20752 | /* End of DataTypeConversion: '<S590>/Data Type Conversion3' */ |
| 20753 | |
| 20754 | /* DataTypeConversion: '<S590>/Data Type Conversion4' */ |
| 20755 | PositionFinalLimited = L4_MABX_B.SFunction1_o5_l; |
| 20756 | if (PositionFinalLimited < 256.0) { |
| 20757 | if (PositionFinalLimited >= 0.0) { |
| 20758 | starting_index = (uint8_T)PositionFinalLimited; |
| 20759 | } else { |
| 20760 | starting_index = 0U; |
| 20761 | } |
| 20762 | } else { |
| 20763 | starting_index = MAX_uint8_T; |
| 20764 | } |
| 20765 | |
| 20766 | L4_MABX_B.DataTypeConversion4_iu = starting_index; |
| 20767 | |
| 20768 | /* End of DataTypeConversion: '<S590>/Data Type Conversion4' */ |
| 20769 | |
| 20770 | /* DataTypeConversion: '<S590>/Data Type Conversion5' */ |
| 20771 | PositionFinalLimited = L4_MABX_B.SFunction1_o6_nq; |
| 20772 | if (PositionFinalLimited < 256.0) { |
| 20773 | if (PositionFinalLimited >= 0.0) { |
| 20774 | starting_index = (uint8_T)PositionFinalLimited; |
| 20775 | } else { |
| 20776 | starting_index = 0U; |
| 20777 | } |
| 20778 | } else { |
| 20779 | starting_index = MAX_uint8_T; |
| 20780 | } |
| 20781 | |
| 20782 | L4_MABX_B.DataTypeConversion5_hq = starting_index; |
| 20783 | |
| 20784 | /* End of DataTypeConversion: '<S590>/Data Type Conversion5' */ |
| 20785 | |
| 20786 | /* DataTypeConversion: '<S590>/Data Type Conversion6' */ |
| 20787 | PositionFinalLimited = L4_MABX_B.SFunction1_o7_lb; |
| 20788 | if (PositionFinalLimited < 256.0) { |
| 20789 | if (PositionFinalLimited >= 0.0) { |
| 20790 | starting_index = (uint8_T)PositionFinalLimited; |
| 20791 | } else { |
| 20792 | starting_index = 0U; |
| 20793 | } |
| 20794 | } else { |
| 20795 | starting_index = MAX_uint8_T; |
| 20796 | } |
| 20797 | |
| 20798 | L4_MABX_B.DataTypeConversion6_d = starting_index; |
| 20799 | |
| 20800 | /* End of DataTypeConversion: '<S590>/Data Type Conversion6' */ |
| 20801 | |
| 20802 | /* DataTypeConversion: '<S590>/Data Type Conversion7' */ |
| 20803 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_bi; |
| 20804 | if (PositionFinalLimited < 256.0) { |
| 20805 | if (PositionFinalLimited >= 0.0) { |
| 20806 | starting_index = (uint8_T)PositionFinalLimited; |
| 20807 | } else { |
| 20808 | starting_index = 0U; |
| 20809 | } |
| 20810 | } else { |
| 20811 | starting_index = MAX_uint8_T; |
| 20812 | } |
| 20813 | |
| 20814 | L4_MABX_B.DataTypeConversion7_ed = starting_index; |
| 20815 | |
| 20816 | /* End of DataTypeConversion: '<S590>/Data Type Conversion7' */ |
| 20817 | |
| 20818 | /* MultiPortSwitch: '<S450>/Multiport_Switch' incorporates: |
| 20819 | * Constant: '<S450>/Constant' |
| 20820 | */ |
| 20821 | switch (PROPB_REAX_CHANNEL_APV) { |
| 20822 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 20823 | /* DataTypeConversion: '<S588>/Data Type Conversion' */ |
| 20824 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_f0; |
| 20825 | if (PositionFinalLimited < 256.0) { |
| 20826 | if (PositionFinalLimited >= 0.0) { |
| 20827 | starting_index = (uint8_T)PositionFinalLimited; |
| 20828 | } else { |
| 20829 | starting_index = 0U; |
| 20830 | } |
| 20831 | } else { |
| 20832 | starting_index = MAX_uint8_T; |
| 20833 | } |
| 20834 | |
| 20835 | L4_MABX_B.DataTypeConversion_kt2 = starting_index; |
| 20836 | |
| 20837 | /* End of DataTypeConversion: '<S588>/Data Type Conversion' */ |
| 20838 | |
| 20839 | /* DataTypeConversion: '<S588>/Data Type Conversion1' */ |
| 20840 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_pl; |
| 20841 | if (PositionFinalLimited < 256.0) { |
| 20842 | if (PositionFinalLimited >= 0.0) { |
| 20843 | starting_index = (uint8_T)PositionFinalLimited; |
| 20844 | } else { |
| 20845 | starting_index = 0U; |
| 20846 | } |
| 20847 | } else { |
| 20848 | starting_index = MAX_uint8_T; |
| 20849 | } |
| 20850 | |
| 20851 | L4_MABX_B.DataTypeConversion1_kf = starting_index; |
| 20852 | |
| 20853 | /* End of DataTypeConversion: '<S588>/Data Type Conversion1' */ |
| 20854 | |
| 20855 | /* DataTypeConversion: '<S588>/Data Type Conversion2' */ |
| 20856 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_pe; |
| 20857 | if (PositionFinalLimited < 256.0) { |
| 20858 | if (PositionFinalLimited >= 0.0) { |
| 20859 | starting_index = (uint8_T)PositionFinalLimited; |
| 20860 | } else { |
| 20861 | starting_index = 0U; |
| 20862 | } |
| 20863 | } else { |
| 20864 | starting_index = MAX_uint8_T; |
| 20865 | } |
| 20866 | |
| 20867 | L4_MABX_B.DataTypeConversion2_mr = starting_index; |
| 20868 | |
| 20869 | /* End of DataTypeConversion: '<S588>/Data Type Conversion2' */ |
| 20870 | |
| 20871 | /* DataTypeConversion: '<S588>/Data Type Conversion3' */ |
| 20872 | PositionFinalLimited = L4_MABX_B.SFunction1_o4_h2; |
| 20873 | if (PositionFinalLimited < 256.0) { |
| 20874 | if (PositionFinalLimited >= 0.0) { |
| 20875 | starting_index = (uint8_T)PositionFinalLimited; |
| 20876 | } else { |
| 20877 | starting_index = 0U; |
| 20878 | } |
| 20879 | } else { |
| 20880 | starting_index = MAX_uint8_T; |
| 20881 | } |
| 20882 | |
| 20883 | L4_MABX_B.DataTypeConversion3_lq = starting_index; |
| 20884 | |
| 20885 | /* End of DataTypeConversion: '<S588>/Data Type Conversion3' */ |
| 20886 | |
| 20887 | /* DataTypeConversion: '<S588>/Data Type Conversion4' */ |
| 20888 | PositionFinalLimited = L4_MABX_B.SFunction1_o5_m0; |
| 20889 | if (PositionFinalLimited < 256.0) { |
| 20890 | if (PositionFinalLimited >= 0.0) { |
| 20891 | starting_index = (uint8_T)PositionFinalLimited; |
| 20892 | } else { |
| 20893 | starting_index = 0U; |
| 20894 | } |
| 20895 | } else { |
| 20896 | starting_index = MAX_uint8_T; |
| 20897 | } |
| 20898 | |
| 20899 | L4_MABX_B.DataTypeConversion4_le = starting_index; |
| 20900 | |
| 20901 | /* End of DataTypeConversion: '<S588>/Data Type Conversion4' */ |
| 20902 | |
| 20903 | /* DataTypeConversion: '<S588>/Data Type Conversion5' */ |
| 20904 | PositionFinalLimited = L4_MABX_B.SFunction1_o6_b1; |
| 20905 | if (PositionFinalLimited < 256.0) { |
| 20906 | if (PositionFinalLimited >= 0.0) { |
| 20907 | starting_index = (uint8_T)PositionFinalLimited; |
| 20908 | } else { |
| 20909 | starting_index = 0U; |
| 20910 | } |
| 20911 | } else { |
| 20912 | starting_index = MAX_uint8_T; |
| 20913 | } |
| 20914 | |
| 20915 | L4_MABX_B.DataTypeConversion5_dk = starting_index; |
| 20916 | |
| 20917 | /* End of DataTypeConversion: '<S588>/Data Type Conversion5' */ |
| 20918 | |
| 20919 | /* DataTypeConversion: '<S588>/Data Type Conversion6' */ |
| 20920 | PositionFinalLimited = L4_MABX_B.SFunction1_o7_al; |
| 20921 | if (PositionFinalLimited < 256.0) { |
| 20922 | if (PositionFinalLimited >= 0.0) { |
| 20923 | starting_index = (uint8_T)PositionFinalLimited; |
| 20924 | } else { |
| 20925 | starting_index = 0U; |
| 20926 | } |
| 20927 | } else { |
| 20928 | starting_index = MAX_uint8_T; |
| 20929 | } |
| 20930 | |
| 20931 | L4_MABX_B.DataTypeConversion6_fl = starting_index; |
| 20932 | |
| 20933 | /* End of DataTypeConversion: '<S588>/Data Type Conversion6' */ |
| 20934 | |
| 20935 | /* DataTypeConversion: '<S588>/Data Type Conversion7' */ |
| 20936 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_ar; |
| 20937 | if (PositionFinalLimited < 256.0) { |
| 20938 | if (PositionFinalLimited >= 0.0) { |
| 20939 | starting_index = (uint8_T)PositionFinalLimited; |
| 20940 | } else { |
| 20941 | starting_index = 0U; |
| 20942 | } |
| 20943 | } else { |
| 20944 | starting_index = MAX_uint8_T; |
| 20945 | } |
| 20946 | |
| 20947 | L4_MABX_B.DataTypeConversion7_ix = starting_index; |
| 20948 | |
| 20949 | /* End of DataTypeConversion: '<S588>/Data Type Conversion7' */ |
| 20950 | L4_MABX_B.RawData_p[0] = L4_MABX_B.DataTypeConversion_kt2; |
| 20951 | L4_MABX_B.RawData_p[1] = L4_MABX_B.DataTypeConversion1_kf; |
| 20952 | L4_MABX_B.RawData_p[2] = L4_MABX_B.DataTypeConversion2_mr; |
| 20953 | L4_MABX_B.RawData_p[3] = L4_MABX_B.DataTypeConversion3_lq; |
| 20954 | L4_MABX_B.RawData_p[4] = L4_MABX_B.DataTypeConversion4_le; |
| 20955 | L4_MABX_B.RawData_p[5] = L4_MABX_B.DataTypeConversion5_dk; |
| 20956 | L4_MABX_B.RawData_p[6] = L4_MABX_B.DataTypeConversion6_fl; |
| 20957 | L4_MABX_B.RawData_p[7] = L4_MABX_B.DataTypeConversion7_ix; |
| 20958 | break; |
| 20959 | |
| 20960 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 20961 | L4_MABX_B.RawData_p[0] = L4_MABX_B.DataTypeConversion_h1; |
| 20962 | L4_MABX_B.RawData_p[1] = L4_MABX_B.DataTypeConversion1_lj; |
| 20963 | L4_MABX_B.RawData_p[2] = L4_MABX_B.DataTypeConversion2_j; |
| 20964 | L4_MABX_B.RawData_p[3] = L4_MABX_B.DataTypeConversion3_gc; |
| 20965 | L4_MABX_B.RawData_p[4] = L4_MABX_B.DataTypeConversion4_ec; |
| 20966 | L4_MABX_B.RawData_p[5] = L4_MABX_B.DataTypeConversion5_b; |
| 20967 | L4_MABX_B.RawData_p[6] = L4_MABX_B.DataTypeConversion6_g; |
| 20968 | L4_MABX_B.RawData_p[7] = L4_MABX_B.DataTypeConversion7_ic; |
| 20969 | break; |
| 20970 | |
| 20971 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 20972 | L4_MABX_B.RawData_p[0] = L4_MABX_B.DataTypeConversion_h1; |
| 20973 | L4_MABX_B.RawData_p[1] = L4_MABX_B.DataTypeConversion1_lj; |
| 20974 | L4_MABX_B.RawData_p[2] = L4_MABX_B.DataTypeConversion2_j; |
| 20975 | L4_MABX_B.RawData_p[3] = L4_MABX_B.DataTypeConversion3_gc; |
| 20976 | L4_MABX_B.RawData_p[4] = L4_MABX_B.DataTypeConversion4_ec; |
| 20977 | L4_MABX_B.RawData_p[5] = L4_MABX_B.DataTypeConversion5_b; |
| 20978 | L4_MABX_B.RawData_p[6] = L4_MABX_B.DataTypeConversion6_g; |
| 20979 | L4_MABX_B.RawData_p[7] = L4_MABX_B.DataTypeConversion7_ic; |
| 20980 | break; |
| 20981 | |
| 20982 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 20983 | L4_MABX_B.RawData_p[0] = L4_MABX_B.DataTypeConversion_h1; |
| 20984 | L4_MABX_B.RawData_p[1] = L4_MABX_B.DataTypeConversion1_lj; |
| 20985 | L4_MABX_B.RawData_p[2] = L4_MABX_B.DataTypeConversion2_j; |
| 20986 | L4_MABX_B.RawData_p[3] = L4_MABX_B.DataTypeConversion3_gc; |
| 20987 | L4_MABX_B.RawData_p[4] = L4_MABX_B.DataTypeConversion4_ec; |
| 20988 | L4_MABX_B.RawData_p[5] = L4_MABX_B.DataTypeConversion5_b; |
| 20989 | L4_MABX_B.RawData_p[6] = L4_MABX_B.DataTypeConversion6_g; |
| 20990 | L4_MABX_B.RawData_p[7] = L4_MABX_B.DataTypeConversion7_ic; |
| 20991 | break; |
| 20992 | |
| 20993 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 20994 | L4_MABX_B.RawData_p[0] = L4_MABX_B.DataTypeConversion_h1; |
| 20995 | L4_MABX_B.RawData_p[1] = L4_MABX_B.DataTypeConversion1_lj; |
| 20996 | L4_MABX_B.RawData_p[2] = L4_MABX_B.DataTypeConversion2_j; |
| 20997 | L4_MABX_B.RawData_p[3] = L4_MABX_B.DataTypeConversion3_gc; |
| 20998 | L4_MABX_B.RawData_p[4] = L4_MABX_B.DataTypeConversion4_ec; |
| 20999 | L4_MABX_B.RawData_p[5] = L4_MABX_B.DataTypeConversion5_b; |
| 21000 | L4_MABX_B.RawData_p[6] = L4_MABX_B.DataTypeConversion6_g; |
| 21001 | L4_MABX_B.RawData_p[7] = L4_MABX_B.DataTypeConversion7_ic; |
| 21002 | break; |
| 21003 | |
| 21004 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 21005 | L4_MABX_B.RawData_p[0] = L4_MABX_B.DataTypeConversion_ld; |
| 21006 | L4_MABX_B.RawData_p[1] = L4_MABX_B.DataTypeConversion1_j1; |
| 21007 | L4_MABX_B.RawData_p[2] = L4_MABX_B.DataTypeConversion2_el; |
| 21008 | L4_MABX_B.RawData_p[3] = L4_MABX_B.DataTypeConversion3_em; |
| 21009 | L4_MABX_B.RawData_p[4] = L4_MABX_B.DataTypeConversion4_iu; |
| 21010 | L4_MABX_B.RawData_p[5] = L4_MABX_B.DataTypeConversion5_hq; |
| 21011 | L4_MABX_B.RawData_p[6] = L4_MABX_B.DataTypeConversion6_d; |
| 21012 | L4_MABX_B.RawData_p[7] = L4_MABX_B.DataTypeConversion7_ed; |
| 21013 | break; |
| 21014 | |
| 21015 | default: |
| 21016 | L4_MABX_B.RawData_p[0] = L4_MABX_B.DataTypeConversion_ld; |
| 21017 | L4_MABX_B.RawData_p[1] = L4_MABX_B.DataTypeConversion1_j1; |
| 21018 | L4_MABX_B.RawData_p[2] = L4_MABX_B.DataTypeConversion2_el; |
| 21019 | L4_MABX_B.RawData_p[3] = L4_MABX_B.DataTypeConversion3_em; |
| 21020 | L4_MABX_B.RawData_p[4] = L4_MABX_B.DataTypeConversion4_iu; |
| 21021 | L4_MABX_B.RawData_p[5] = L4_MABX_B.DataTypeConversion5_hq; |
| 21022 | L4_MABX_B.RawData_p[6] = L4_MABX_B.DataTypeConversion6_d; |
| 21023 | L4_MABX_B.RawData_p[7] = L4_MABX_B.DataTypeConversion7_ed; |
| 21024 | break; |
| 21025 | } |
| 21026 | |
| 21027 | /* S-Function (sfix_bitop): '<S678>/Operator' */ |
| 21028 | L4_MABX_B.Operator_ea = (uint8_T)(L4_MABX_B.RawData_p[0] & |
| 21029 | L4_MABX_P.Operator_BitMask_lh); |
| 21030 | |
| 21031 | /* DataTypeConversion: '<S678>/DataType' */ |
| 21032 | L4_MABX_B.DataType_bm = L4_MABX_B.Operator_ea; |
| 21033 | |
| 21034 | /* DataTypeConversion: '<S425>/Data Type Conversion' */ |
| 21035 | REAX_Current_Mode = L4_MABX_B.DataType_bm; |
| 21036 | |
| 21037 | /* S-Function (sfix_bitop): '<S677>/Operator' */ |
| 21038 | L4_MABX_B.Operator_nj = (uint8_T)(L4_MABX_B.RawData_p[0] & |
| 21039 | L4_MABX_P.Operator_BitMask_py); |
| 21040 | |
| 21041 | /* DataTypeConversion: '<S677>/DataType' */ |
| 21042 | L4_MABX_B.DataType_bg = L4_MABX_B.Operator_nj; |
| 21043 | |
| 21044 | /* ArithShift: '<S672>/Shift_Arithmetic ' */ |
| 21045 | L4_MABX_B.PropB_REAX_3_ReqOperatingMode = (uint8_T)((uint32_T) |
| 21046 | L4_MABX_B.DataType_bg >> 4); |
| 21047 | |
| 21048 | /* DataTypeConversion: '<S425>/Data Type Conversion1' */ |
| 21049 | REAX_Req_Mode = L4_MABX_B.PropB_REAX_3_ReqOperatingMode; |
| 21050 | |
| 21051 | /* DataTypeConversion: '<S425>/Data Type Conversion2' */ |
| 21052 | REAX_Status = L4_MABX_B.RawData_p[1]; |
| 21053 | |
| 21054 | /* DataTypeConversion: '<S674>/Data Type Conversion1' */ |
| 21055 | L4_MABX_B.DataTypeConversion1_p = L4_MABX_B.RawData_p[2]; |
| 21056 | |
| 21057 | /* DataTypeConversion: '<S674>/Data Type Conversion2' */ |
| 21058 | L4_MABX_B.DataTypeConversion2_a2 = L4_MABX_B.RawData_p[3]; |
| 21059 | |
| 21060 | /* ArithShift: '<S674>/Shift_Arithmetic 1' */ |
| 21061 | L4_MABX_B.Shift_Arithmetic1_nf = (uint16_T)(L4_MABX_B.DataTypeConversion2_a2 << |
| 21062 | 8); |
| 21063 | |
| 21064 | /* S-Function (sfix_bitop): '<S679>/Operator' */ |
| 21065 | L4_MABX_B.Operator_ay = (uint16_T)(L4_MABX_B.DataTypeConversion1_p | |
| 21066 | L4_MABX_B.Shift_Arithmetic1_nf); |
| 21067 | |
| 21068 | /* DataTypeConversion: '<S679>/DataType' */ |
| 21069 | L4_MABX_B.DataType_jt = L4_MABX_B.Operator_ay; |
| 21070 | |
| 21071 | /* DataTypeConversion: '<S674>/Data Type Conversion3' */ |
| 21072 | L4_MABX_B.DataTypeConversion3_im = (int16_T)L4_MABX_B.DataType_jt; |
| 21073 | |
| 21074 | /* DataTypeConversion: '<S674>/Data Type Conversion4' */ |
| 21075 | L4_MABX_B.DataTypeConversion4_a = L4_MABX_B.DataTypeConversion3_im; |
| 21076 | |
| 21077 | /* Product: '<S674>/Product' incorporates: |
| 21078 | * Constant: '<S674>/Constant' |
| 21079 | */ |
| 21080 | L4_MABX_B.PropB_REAX_3_HandwheelTorque = (real32_T) |
| 21081 | (L4_MABX_B.DataTypeConversion4_a * L4_MABX_P.Constant_Value_f5); |
| 21082 | |
| 21083 | /* DataTypeConversion: '<S425>/Data Type Conversion3' */ |
| 21084 | REAX_Handwheel_Torque = L4_MABX_B.PropB_REAX_3_HandwheelTorque; |
| 21085 | |
| 21086 | /* DataTypeConversion: '<S675>/Data Type Conversion4' */ |
| 21087 | L4_MABX_B.DataTypeConversion4_i5 = L4_MABX_B.RawData_p[4]; |
| 21088 | |
| 21089 | /* DataTypeConversion: '<S675>/Data Type Conversion5' */ |
| 21090 | L4_MABX_B.DataTypeConversion5_d3 = L4_MABX_B.RawData_p[5]; |
| 21091 | |
| 21092 | /* ArithShift: '<S675>/Shift_Arithmetic 2' */ |
| 21093 | L4_MABX_B.Shift_Arithmetic2_c = (uint16_T)(L4_MABX_B.DataTypeConversion5_d3 << |
| 21094 | 8); |
| 21095 | |
| 21096 | /* S-Function (sfix_bitop): '<S680>/Operator' */ |
| 21097 | L4_MABX_B.Operator_iu = (uint16_T)(L4_MABX_B.DataTypeConversion4_i5 | |
| 21098 | L4_MABX_B.Shift_Arithmetic2_c); |
| 21099 | |
| 21100 | /* DataTypeConversion: '<S680>/DataType' */ |
| 21101 | L4_MABX_B.DataType_bv = L4_MABX_B.Operator_iu; |
| 21102 | |
| 21103 | /* DataTypeConversion: '<S675>/Data Type Conversion6' */ |
| 21104 | L4_MABX_B.DataTypeConversion6_j = (int16_T)L4_MABX_B.DataType_bv; |
| 21105 | |
| 21106 | /* DataTypeConversion: '<S675>/Data Type Conversion1' */ |
| 21107 | L4_MABX_B.DataTypeConversion1_m = L4_MABX_B.DataTypeConversion6_j; |
| 21108 | |
| 21109 | /* Product: '<S675>/Product1' incorporates: |
| 21110 | * Constant: '<S675>/Constant1' |
| 21111 | */ |
| 21112 | L4_MABX_B.PropB_REAX_3_HandwheelVelocity = (real32_T) |
| 21113 | (L4_MABX_B.DataTypeConversion1_m * L4_MABX_P.Constant1_Value_fw); |
| 21114 | |
| 21115 | /* DataTypeConversion: '<S425>/Data Type Conversion4' */ |
| 21116 | REAX_Handwheel_Velocity = L4_MABX_B.PropB_REAX_3_HandwheelVelocity; |
| 21117 | |
| 21118 | /* DataTypeConversion: '<S676>/Data Type Conversion7' */ |
| 21119 | L4_MABX_B.DataTypeConversion7_g = L4_MABX_B.RawData_p[6]; |
| 21120 | |
| 21121 | /* DataTypeConversion: '<S676>/Data Type Conversion8' */ |
| 21122 | L4_MABX_B.DataTypeConversion8_f = L4_MABX_B.RawData_p[7]; |
| 21123 | |
| 21124 | /* ArithShift: '<S676>/Shift_Arithmetic 3' */ |
| 21125 | L4_MABX_B.Shift_Arithmetic3_fa = (uint16_T)(L4_MABX_B.DataTypeConversion8_f << |
| 21126 | 8); |
| 21127 | |
| 21128 | /* S-Function (sfix_bitop): '<S681>/Operator' */ |
| 21129 | L4_MABX_B.Operator_ae = (uint16_T)(L4_MABX_B.DataTypeConversion7_g | |
| 21130 | L4_MABX_B.Shift_Arithmetic3_fa); |
| 21131 | |
| 21132 | /* DataTypeConversion: '<S681>/DataType' */ |
| 21133 | L4_MABX_B.DataType_pp = L4_MABX_B.Operator_ae; |
| 21134 | |
| 21135 | /* DataTypeConversion: '<S676>/Data Type Conversion9' */ |
| 21136 | L4_MABX_B.DataTypeConversion9_i = (int16_T)L4_MABX_B.DataType_pp; |
| 21137 | |
| 21138 | /* DataTypeConversion: '<S676>/Data Type Conversion1' */ |
| 21139 | L4_MABX_B.DataTypeConversion1_e = L4_MABX_B.DataTypeConversion9_i; |
| 21140 | |
| 21141 | /* Product: '<S676>/Product2' incorporates: |
| 21142 | * Constant: '<S676>/Constant2' |
| 21143 | */ |
| 21144 | L4_MABX_B.PropB_REAX_3_PullCompensation = (real32_T) |
| 21145 | (L4_MABX_B.DataTypeConversion1_e * L4_MABX_P.Constant2_Value_hh); |
| 21146 | |
| 21147 | /* DataTypeConversion: '<S425>/Data Type Conversion5' */ |
| 21148 | REAX_Pull_Compensation = L4_MABX_B.PropB_REAX_3_PullCompensation; |
| 21149 | |
| 21150 | /* DataTypeConversion: '<S589>/Data Type Conversion8' */ |
| 21151 | L4_MABX_B.RX_status_i = (L4_MABX_B.SFunction1_o9_jm != 0.0); |
| 21152 | |
| 21153 | /* DataTypeConversion: '<S590>/Data Type Conversion8' */ |
| 21154 | L4_MABX_B.RX_status_bv = (L4_MABX_B.SFunction1_o9_kq != 0.0); |
| 21155 | |
| 21156 | /* MultiPortSwitch: '<S450>/Multiport_Switch' incorporates: |
| 21157 | * Constant: '<S450>/Constant' |
| 21158 | */ |
| 21159 | switch (PROPB_REAX_CHANNEL_APV) { |
| 21160 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 21161 | /* DataTypeConversion: '<S588>/Data Type Conversion8' */ |
| 21162 | L4_MABX_B.RX_status_md = (L4_MABX_B.SFunction1_o9_i4 != 0.0); |
| 21163 | L4_MABX_B.RX_status_nd = L4_MABX_B.RX_status_md; |
| 21164 | break; |
| 21165 | |
| 21166 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 21167 | L4_MABX_B.RX_status_nd = L4_MABX_B.RX_status_i; |
| 21168 | break; |
| 21169 | |
| 21170 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 21171 | L4_MABX_B.RX_status_nd = L4_MABX_B.RX_status_i; |
| 21172 | break; |
| 21173 | |
| 21174 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 21175 | L4_MABX_B.RX_status_nd = L4_MABX_B.RX_status_i; |
| 21176 | break; |
| 21177 | |
| 21178 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 21179 | L4_MABX_B.RX_status_nd = L4_MABX_B.RX_status_i; |
| 21180 | break; |
| 21181 | |
| 21182 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 21183 | L4_MABX_B.RX_status_nd = L4_MABX_B.RX_status_bv; |
| 21184 | break; |
| 21185 | |
| 21186 | default: |
| 21187 | L4_MABX_B.RX_status_nd = L4_MABX_B.RX_status_bv; |
| 21188 | break; |
| 21189 | } |
| 21190 | |
| 21191 | /* DataTypeConversion: '<S589>/Data Type Conversion9' */ |
| 21192 | L4_MABX_B.RX_time_dq = L4_MABX_B.SFunction1_o10_o; |
| 21193 | |
| 21194 | /* DataTypeConversion: '<S590>/Data Type Conversion9' */ |
| 21195 | L4_MABX_B.RX_time_it = L4_MABX_B.SFunction1_o10_f; |
| 21196 | |
| 21197 | /* MultiPortSwitch: '<S450>/Multiport_Switch' incorporates: |
| 21198 | * Constant: '<S450>/Constant' |
| 21199 | */ |
| 21200 | switch (PROPB_REAX_CHANNEL_APV) { |
| 21201 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 21202 | /* DataTypeConversion: '<S588>/Data Type Conversion9' */ |
| 21203 | L4_MABX_B.RX_time_cx = L4_MABX_B.SFunction1_o10_hc; |
| 21204 | L4_MABX_B.RX_time_k3 = L4_MABX_B.RX_time_cx; |
| 21205 | break; |
| 21206 | |
| 21207 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 21208 | L4_MABX_B.RX_time_k3 = L4_MABX_B.RX_time_dq; |
| 21209 | break; |
| 21210 | |
| 21211 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 21212 | L4_MABX_B.RX_time_k3 = L4_MABX_B.RX_time_dq; |
| 21213 | break; |
| 21214 | |
| 21215 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 21216 | L4_MABX_B.RX_time_k3 = L4_MABX_B.RX_time_dq; |
| 21217 | break; |
| 21218 | |
| 21219 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 21220 | L4_MABX_B.RX_time_k3 = L4_MABX_B.RX_time_dq; |
| 21221 | break; |
| 21222 | |
| 21223 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 21224 | L4_MABX_B.RX_time_k3 = L4_MABX_B.RX_time_it; |
| 21225 | break; |
| 21226 | |
| 21227 | default: |
| 21228 | L4_MABX_B.RX_time_k3 = L4_MABX_B.RX_time_it; |
| 21229 | break; |
| 21230 | } |
| 21231 | |
| 21232 | /* DataTypeConversion: '<S589>/Data Type Conversion10' */ |
| 21233 | L4_MABX_B.RX_delta_time_bc = L4_MABX_B.SFunction1_o11_fl; |
| 21234 | |
| 21235 | /* DataTypeConversion: '<S590>/Data Type Conversion10' */ |
| 21236 | L4_MABX_B.RX_delta_time_in = L4_MABX_B.SFunction1_o11_o; |
| 21237 | |
| 21238 | /* MultiPortSwitch: '<S450>/Multiport_Switch' incorporates: |
| 21239 | * Constant: '<S450>/Constant' |
| 21240 | */ |
| 21241 | switch (PROPB_REAX_CHANNEL_APV) { |
| 21242 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 21243 | /* DataTypeConversion: '<S588>/Data Type Conversion10' */ |
| 21244 | L4_MABX_B.RX_delta_time_pa = L4_MABX_B.SFunction1_o11_n; |
| 21245 | L4_MABX_B.RX_delta_time_ip = L4_MABX_B.RX_delta_time_pa; |
| 21246 | break; |
| 21247 | |
| 21248 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 21249 | L4_MABX_B.RX_delta_time_ip = L4_MABX_B.RX_delta_time_bc; |
| 21250 | break; |
| 21251 | |
| 21252 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 21253 | L4_MABX_B.RX_delta_time_ip = L4_MABX_B.RX_delta_time_bc; |
| 21254 | break; |
| 21255 | |
| 21256 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 21257 | L4_MABX_B.RX_delta_time_ip = L4_MABX_B.RX_delta_time_bc; |
| 21258 | break; |
| 21259 | |
| 21260 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 21261 | L4_MABX_B.RX_delta_time_ip = L4_MABX_B.RX_delta_time_bc; |
| 21262 | break; |
| 21263 | |
| 21264 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 21265 | L4_MABX_B.RX_delta_time_ip = L4_MABX_B.RX_delta_time_in; |
| 21266 | break; |
| 21267 | |
| 21268 | default: |
| 21269 | L4_MABX_B.RX_delta_time_ip = L4_MABX_B.RX_delta_time_in; |
| 21270 | break; |
| 21271 | } |
| 21272 | |
| 21273 | /* RelationalOperator: '<S597>/Operator' incorporates: |
| 21274 | * Constant: '<S450>/Constant' |
| 21275 | * Constant: '<S591>/Constant2' |
| 21276 | */ |
| 21277 | L4_MABX_B.Operator_pzw = (PROPB_REAX_CHANNEL_APV == |
| 21278 | L4_MABX_P.Constant2_Value_o); |
| 21279 | |
| 21280 | /* RelationalOperator: '<S598>/Operator' incorporates: |
| 21281 | * Constant: '<S450>/Constant' |
| 21282 | * Constant: '<S591>/Constant3' |
| 21283 | */ |
| 21284 | L4_MABX_B.Operator_pt = (PROPB_REAX_CHANNEL_APV == |
| 21285 | L4_MABX_P.Constant3_Value_lx); |
| 21286 | |
| 21287 | /* RelationalOperator: '<S599>/Operator' incorporates: |
| 21288 | * Constant: '<S450>/Constant' |
| 21289 | * Constant: '<S591>/Constant4' |
| 21290 | */ |
| 21291 | L4_MABX_B.Operator_fo = (PROPB_REAX_CHANNEL_APV == L4_MABX_P.Constant4_Value_c); |
| 21292 | |
| 21293 | /* RelationalOperator: '<S608>/Operator' incorporates: |
| 21294 | * Constant: '<S451>/Constant' |
| 21295 | * Constant: '<S604>/Constant' |
| 21296 | */ |
| 21297 | L4_MABX_B.Operator_c2 = (PROPB_REAX_CHANNEL_APV == L4_MABX_P.Constant_Value_er); |
| 21298 | |
| 21299 | /* Outputs for Enabled SubSystem: '<S601>/CAN_TYPE1_RX_M1_C1' incorporates: |
| 21300 | * EnablePort: '<S605>/Enable' |
| 21301 | */ |
| 21302 | if (L4_MABX_B.Operator_c2) { |
| 21303 | /* S-Function (rti_commonblock): '<S605>/S-Function1' */ |
| 21304 | /* This comment workarounds a code generation problem */ |
| 21305 | |
| 21306 | /* dSPACE RTICAN RX Message Block: "PropB_REAX_4_13" Id:419428115 */ |
| 21307 | { |
| 21308 | UInt32 *CAN_Msg; |
| 21309 | static dsfloat time_old = 0.0; |
| 21310 | |
| 21311 | /* Read status and timestamp info (previous message) */ |
| 21312 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF713].timestamp != |
| 21313 | time_old) { |
| 21314 | /* ... save timestamp info for the calculation of the RX status |
| 21315 | during the consecutive sample hit*/ |
| 21316 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF713]. |
| 21317 | timestamp; |
| 21318 | |
| 21319 | /* ... set the processed flag to one */ |
| 21320 | L4_MABX_B.SFunction1_o9_e = 1.0; |
| 21321 | L4_MABX_B.SFunction1_o10_a = (real_T) |
| 21322 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF713].timestamp; |
| 21323 | L4_MABX_B.SFunction1_o11_f = (real_T) |
| 21324 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF713].deltatime; |
| 21325 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF713].data; |
| 21326 | |
| 21327 | /* Decode CAN message */ |
| 21328 | { |
| 21329 | { |
| 21330 | rtican_Signal_t CAN_Sgn; |
| 21331 | |
| 21332 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 21333 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 21334 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21335 | L4_MABX_B.SFunction1_o1_nw = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21336 | |
| 21337 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 21338 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 21339 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21340 | L4_MABX_B.SFunction1_o2_bx = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21341 | |
| 21342 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 21343 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 21344 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21345 | L4_MABX_B.SFunction1_o3_hu = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21346 | |
| 21347 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 21348 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 21349 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21350 | L4_MABX_B.SFunction1_o4_i2 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21351 | |
| 21352 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 21353 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 21354 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21355 | L4_MABX_B.SFunction1_o5_mc = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21356 | |
| 21357 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 21358 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 21359 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21360 | L4_MABX_B.SFunction1_o6_bm = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21361 | |
| 21362 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 21363 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 21364 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21365 | L4_MABX_B.SFunction1_o7_p0 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21366 | |
| 21367 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 21368 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 21369 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21370 | L4_MABX_B.SFunction1_o8_j = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21371 | } |
| 21372 | } |
| 21373 | } else { |
| 21374 | /* set RX status to 0 because no new message has arrived */ |
| 21375 | L4_MABX_B.SFunction1_o9_e = 0.0; |
| 21376 | } |
| 21377 | } |
| 21378 | } |
| 21379 | |
| 21380 | /* End of Outputs for SubSystem: '<S601>/CAN_TYPE1_RX_M1_C1' */ |
| 21381 | |
| 21382 | /* RelationalOperator: '<S609>/Operator' incorporates: |
| 21383 | * Constant: '<S451>/Constant' |
| 21384 | * Constant: '<S604>/Constant1' |
| 21385 | */ |
| 21386 | L4_MABX_B.Operator_ad = (PROPB_REAX_CHANNEL_APV == |
| 21387 | L4_MABX_P.Constant1_Value_bi); |
| 21388 | |
| 21389 | /* Outputs for Enabled SubSystem: '<S602>/CAN_TYPE1_RX_M1_C2' incorporates: |
| 21390 | * EnablePort: '<S606>/Enable' |
| 21391 | */ |
| 21392 | if (L4_MABX_B.Operator_ad) { |
| 21393 | /* S-Function (rti_commonblock): '<S606>/S-Function1' */ |
| 21394 | /* This comment workarounds a code generation problem */ |
| 21395 | |
| 21396 | /* dSPACE RTICAN RX Message Block: "PropB_REAX_4_13" Id:419428115 */ |
| 21397 | { |
| 21398 | UInt32 *CAN_Msg; |
| 21399 | static dsfloat time_old = 0.0; |
| 21400 | |
| 21401 | /* Read status and timestamp info (previous message) */ |
| 21402 | if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF713].timestamp != |
| 21403 | time_old) { |
| 21404 | /* ... save timestamp info for the calculation of the RX status |
| 21405 | during the consecutive sample hit*/ |
| 21406 | time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF713]. |
| 21407 | timestamp; |
| 21408 | |
| 21409 | /* ... set the processed flag to one */ |
| 21410 | L4_MABX_B.SFunction1_o9_o = 1.0; |
| 21411 | L4_MABX_B.SFunction1_o10_p = (real_T) |
| 21412 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF713].timestamp; |
| 21413 | L4_MABX_B.SFunction1_o11_g = (real_T) |
| 21414 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF713].deltatime; |
| 21415 | CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF713].data; |
| 21416 | |
| 21417 | /* Decode CAN message */ |
| 21418 | { |
| 21419 | { |
| 21420 | rtican_Signal_t CAN_Sgn; |
| 21421 | |
| 21422 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 21423 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 21424 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21425 | L4_MABX_B.SFunction1_o1_dc = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21426 | |
| 21427 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 21428 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 21429 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21430 | L4_MABX_B.SFunction1_o2_bu = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21431 | |
| 21432 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 21433 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 21434 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21435 | L4_MABX_B.SFunction1_o3_mi = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21436 | |
| 21437 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 21438 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 21439 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21440 | L4_MABX_B.SFunction1_o4_hm = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21441 | |
| 21442 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 21443 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 21444 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21445 | L4_MABX_B.SFunction1_o5_bl = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21446 | |
| 21447 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 21448 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 21449 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21450 | L4_MABX_B.SFunction1_o6_e = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21451 | |
| 21452 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 21453 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 21454 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21455 | L4_MABX_B.SFunction1_o7_cl = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21456 | |
| 21457 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 21458 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 21459 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21460 | L4_MABX_B.SFunction1_o8_d = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21461 | } |
| 21462 | } |
| 21463 | } else { |
| 21464 | /* set RX status to 0 because no new message has arrived */ |
| 21465 | L4_MABX_B.SFunction1_o9_o = 0.0; |
| 21466 | } |
| 21467 | } |
| 21468 | } |
| 21469 | |
| 21470 | /* End of Outputs for SubSystem: '<S602>/CAN_TYPE1_RX_M1_C2' */ |
| 21471 | |
| 21472 | /* RelationalOperator: '<S613>/Operator' incorporates: |
| 21473 | * Constant: '<S451>/Constant' |
| 21474 | * Constant: '<S604>/Constant5' |
| 21475 | */ |
| 21476 | L4_MABX_B.Operator_dp = (PROPB_REAX_CHANNEL_APV == |
| 21477 | L4_MABX_P.Constant5_Value_o2); |
| 21478 | |
| 21479 | /* Outputs for Enabled SubSystem: '<S603>/CAN_TYPE1_RX_M3_C2' incorporates: |
| 21480 | * EnablePort: '<S607>/Enable' |
| 21481 | */ |
| 21482 | if (L4_MABX_B.Operator_dp) { |
| 21483 | /* S-Function (rti_commonblock): '<S607>/S-Function1' */ |
| 21484 | /* This comment workarounds a code generation problem */ |
| 21485 | |
| 21486 | /* dSPACE RTICAN RX Message Block: "PropB_REAX_4_13" Id:486536979 */ |
| 21487 | { |
| 21488 | UInt32 *CAN_Msg; |
| 21489 | static dsfloat time_old = 0.0; |
| 21490 | |
| 21491 | /* Read status and timestamp info (previous message) */ |
| 21492 | if (can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF713].timestamp != |
| 21493 | time_old) { |
| 21494 | /* ... save timestamp info for the calculation of the RX status |
| 21495 | during the consecutive sample hit*/ |
| 21496 | time_old = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF713]. |
| 21497 | timestamp; |
| 21498 | |
| 21499 | /* ... set the processed flag to one */ |
| 21500 | L4_MABX_B.SFunction1_o9_h = 1.0; |
| 21501 | L4_MABX_B.SFunction1_o10_c = (real_T) |
| 21502 | can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF713].timestamp; |
| 21503 | L4_MABX_B.SFunction1_o11_a = (real_T) |
| 21504 | can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF713].deltatime; |
| 21505 | CAN_Msg = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF713].data; |
| 21506 | |
| 21507 | /* Decode CAN message */ |
| 21508 | { |
| 21509 | { |
| 21510 | rtican_Signal_t CAN_Sgn; |
| 21511 | |
| 21512 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 21513 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 21514 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21515 | L4_MABX_B.SFunction1_o1_oz = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21516 | |
| 21517 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 21518 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 21519 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21520 | L4_MABX_B.SFunction1_o2_hr = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21521 | |
| 21522 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 21523 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 21524 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21525 | L4_MABX_B.SFunction1_o3_cc = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21526 | |
| 21527 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 21528 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 21529 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21530 | L4_MABX_B.SFunction1_o4_ok = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21531 | |
| 21532 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 21533 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 21534 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21535 | L4_MABX_B.SFunction1_o5_m = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21536 | |
| 21537 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 21538 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 21539 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21540 | L4_MABX_B.SFunction1_o6_p = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21541 | |
| 21542 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 21543 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 21544 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21545 | L4_MABX_B.SFunction1_o7_pe = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21546 | |
| 21547 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 21548 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 21549 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21550 | L4_MABX_B.SFunction1_o8_o = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21551 | } |
| 21552 | } |
| 21553 | } else { |
| 21554 | /* set RX status to 0 because no new message has arrived */ |
| 21555 | L4_MABX_B.SFunction1_o9_h = 0.0; |
| 21556 | } |
| 21557 | } |
| 21558 | } |
| 21559 | |
| 21560 | /* End of Outputs for SubSystem: '<S603>/CAN_TYPE1_RX_M3_C2' */ |
| 21561 | |
| 21562 | /* DataTypeConversion: '<S603>/Data Type Conversion' */ |
| 21563 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_oz; |
| 21564 | if (PositionFinalLimited < 256.0) { |
| 21565 | if (PositionFinalLimited >= 0.0) { |
| 21566 | starting_index = (uint8_T)PositionFinalLimited; |
| 21567 | } else { |
| 21568 | starting_index = 0U; |
| 21569 | } |
| 21570 | } else { |
| 21571 | starting_index = MAX_uint8_T; |
| 21572 | } |
| 21573 | |
| 21574 | L4_MABX_B.DataTypeConversion_ll = starting_index; |
| 21575 | |
| 21576 | /* End of DataTypeConversion: '<S603>/Data Type Conversion' */ |
| 21577 | |
| 21578 | /* DataTypeConversion: '<S603>/Data Type Conversion1' */ |
| 21579 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_hr; |
| 21580 | if (PositionFinalLimited < 256.0) { |
| 21581 | if (PositionFinalLimited >= 0.0) { |
| 21582 | starting_index = (uint8_T)PositionFinalLimited; |
| 21583 | } else { |
| 21584 | starting_index = 0U; |
| 21585 | } |
| 21586 | } else { |
| 21587 | starting_index = MAX_uint8_T; |
| 21588 | } |
| 21589 | |
| 21590 | L4_MABX_B.DataTypeConversion1_ow = starting_index; |
| 21591 | |
| 21592 | /* End of DataTypeConversion: '<S603>/Data Type Conversion1' */ |
| 21593 | |
| 21594 | /* DataTypeConversion: '<S603>/Data Type Conversion2' */ |
| 21595 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_cc; |
| 21596 | if (PositionFinalLimited < 256.0) { |
| 21597 | if (PositionFinalLimited >= 0.0) { |
| 21598 | starting_index = (uint8_T)PositionFinalLimited; |
| 21599 | } else { |
| 21600 | starting_index = 0U; |
| 21601 | } |
| 21602 | } else { |
| 21603 | starting_index = MAX_uint8_T; |
| 21604 | } |
| 21605 | |
| 21606 | L4_MABX_B.DataTypeConversion2_nq = starting_index; |
| 21607 | |
| 21608 | /* End of DataTypeConversion: '<S603>/Data Type Conversion2' */ |
| 21609 | |
| 21610 | /* DataTypeConversion: '<S603>/Data Type Conversion3' */ |
| 21611 | PositionFinalLimited = L4_MABX_B.SFunction1_o4_ok; |
| 21612 | if (PositionFinalLimited < 256.0) { |
| 21613 | if (PositionFinalLimited >= 0.0) { |
| 21614 | starting_index = (uint8_T)PositionFinalLimited; |
| 21615 | } else { |
| 21616 | starting_index = 0U; |
| 21617 | } |
| 21618 | } else { |
| 21619 | starting_index = MAX_uint8_T; |
| 21620 | } |
| 21621 | |
| 21622 | L4_MABX_B.DataTypeConversion3_dq = starting_index; |
| 21623 | |
| 21624 | /* End of DataTypeConversion: '<S603>/Data Type Conversion3' */ |
| 21625 | |
| 21626 | /* DataTypeConversion: '<S603>/Data Type Conversion4' */ |
| 21627 | PositionFinalLimited = L4_MABX_B.SFunction1_o5_m; |
| 21628 | if (PositionFinalLimited < 256.0) { |
| 21629 | if (PositionFinalLimited >= 0.0) { |
| 21630 | starting_index = (uint8_T)PositionFinalLimited; |
| 21631 | } else { |
| 21632 | starting_index = 0U; |
| 21633 | } |
| 21634 | } else { |
| 21635 | starting_index = MAX_uint8_T; |
| 21636 | } |
| 21637 | |
| 21638 | L4_MABX_B.DataTypeConversion4_j2 = starting_index; |
| 21639 | |
| 21640 | /* End of DataTypeConversion: '<S603>/Data Type Conversion4' */ |
| 21641 | |
| 21642 | /* DataTypeConversion: '<S603>/Data Type Conversion5' */ |
| 21643 | PositionFinalLimited = L4_MABX_B.SFunction1_o6_p; |
| 21644 | if (PositionFinalLimited < 256.0) { |
| 21645 | if (PositionFinalLimited >= 0.0) { |
| 21646 | starting_index = (uint8_T)PositionFinalLimited; |
| 21647 | } else { |
| 21648 | starting_index = 0U; |
| 21649 | } |
| 21650 | } else { |
| 21651 | starting_index = MAX_uint8_T; |
| 21652 | } |
| 21653 | |
| 21654 | L4_MABX_B.DataTypeConversion5_gc = starting_index; |
| 21655 | |
| 21656 | /* End of DataTypeConversion: '<S603>/Data Type Conversion5' */ |
| 21657 | |
| 21658 | /* DataTypeConversion: '<S603>/Data Type Conversion6' */ |
| 21659 | PositionFinalLimited = L4_MABX_B.SFunction1_o7_pe; |
| 21660 | if (PositionFinalLimited < 256.0) { |
| 21661 | if (PositionFinalLimited >= 0.0) { |
| 21662 | starting_index = (uint8_T)PositionFinalLimited; |
| 21663 | } else { |
| 21664 | starting_index = 0U; |
| 21665 | } |
| 21666 | } else { |
| 21667 | starting_index = MAX_uint8_T; |
| 21668 | } |
| 21669 | |
| 21670 | L4_MABX_B.DataTypeConversion6_m = starting_index; |
| 21671 | |
| 21672 | /* End of DataTypeConversion: '<S603>/Data Type Conversion6' */ |
| 21673 | |
| 21674 | /* DataTypeConversion: '<S603>/Data Type Conversion7' */ |
| 21675 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_o; |
| 21676 | if (PositionFinalLimited < 256.0) { |
| 21677 | if (PositionFinalLimited >= 0.0) { |
| 21678 | starting_index = (uint8_T)PositionFinalLimited; |
| 21679 | } else { |
| 21680 | starting_index = 0U; |
| 21681 | } |
| 21682 | } else { |
| 21683 | starting_index = MAX_uint8_T; |
| 21684 | } |
| 21685 | |
| 21686 | L4_MABX_B.DataTypeConversion7_p = starting_index; |
| 21687 | |
| 21688 | /* End of DataTypeConversion: '<S603>/Data Type Conversion7' */ |
| 21689 | |
| 21690 | /* MultiPortSwitch: '<S451>/Multiport_Switch' incorporates: |
| 21691 | * Constant: '<S451>/Constant' |
| 21692 | */ |
| 21693 | switch (PROPB_REAX_CHANNEL_APV) { |
| 21694 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 21695 | /* DataTypeConversion: '<S601>/Data Type Conversion' */ |
| 21696 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_nw; |
| 21697 | if (PositionFinalLimited < 256.0) { |
| 21698 | if (PositionFinalLimited >= 0.0) { |
| 21699 | starting_index = (uint8_T)PositionFinalLimited; |
| 21700 | } else { |
| 21701 | starting_index = 0U; |
| 21702 | } |
| 21703 | } else { |
| 21704 | starting_index = MAX_uint8_T; |
| 21705 | } |
| 21706 | |
| 21707 | L4_MABX_B.DataTypeConversion_ar = starting_index; |
| 21708 | |
| 21709 | /* End of DataTypeConversion: '<S601>/Data Type Conversion' */ |
| 21710 | |
| 21711 | /* DataTypeConversion: '<S601>/Data Type Conversion1' */ |
| 21712 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_bx; |
| 21713 | if (PositionFinalLimited < 256.0) { |
| 21714 | if (PositionFinalLimited >= 0.0) { |
| 21715 | starting_index = (uint8_T)PositionFinalLimited; |
| 21716 | } else { |
| 21717 | starting_index = 0U; |
| 21718 | } |
| 21719 | } else { |
| 21720 | starting_index = MAX_uint8_T; |
| 21721 | } |
| 21722 | |
| 21723 | L4_MABX_B.DataTypeConversion1_jj = starting_index; |
| 21724 | |
| 21725 | /* End of DataTypeConversion: '<S601>/Data Type Conversion1' */ |
| 21726 | |
| 21727 | /* DataTypeConversion: '<S601>/Data Type Conversion2' */ |
| 21728 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_hu; |
| 21729 | if (PositionFinalLimited < 256.0) { |
| 21730 | if (PositionFinalLimited >= 0.0) { |
| 21731 | starting_index = (uint8_T)PositionFinalLimited; |
| 21732 | } else { |
| 21733 | starting_index = 0U; |
| 21734 | } |
| 21735 | } else { |
| 21736 | starting_index = MAX_uint8_T; |
| 21737 | } |
| 21738 | |
| 21739 | L4_MABX_B.DataTypeConversion2_a2z = starting_index; |
| 21740 | |
| 21741 | /* End of DataTypeConversion: '<S601>/Data Type Conversion2' */ |
| 21742 | |
| 21743 | /* DataTypeConversion: '<S601>/Data Type Conversion3' */ |
| 21744 | PositionFinalLimited = L4_MABX_B.SFunction1_o4_i2; |
| 21745 | if (PositionFinalLimited < 256.0) { |
| 21746 | if (PositionFinalLimited >= 0.0) { |
| 21747 | starting_index = (uint8_T)PositionFinalLimited; |
| 21748 | } else { |
| 21749 | starting_index = 0U; |
| 21750 | } |
| 21751 | } else { |
| 21752 | starting_index = MAX_uint8_T; |
| 21753 | } |
| 21754 | |
| 21755 | L4_MABX_B.DataTypeConversion3_mn = starting_index; |
| 21756 | |
| 21757 | /* End of DataTypeConversion: '<S601>/Data Type Conversion3' */ |
| 21758 | |
| 21759 | /* DataTypeConversion: '<S601>/Data Type Conversion4' */ |
| 21760 | PositionFinalLimited = L4_MABX_B.SFunction1_o5_mc; |
| 21761 | if (PositionFinalLimited < 256.0) { |
| 21762 | if (PositionFinalLimited >= 0.0) { |
| 21763 | starting_index = (uint8_T)PositionFinalLimited; |
| 21764 | } else { |
| 21765 | starting_index = 0U; |
| 21766 | } |
| 21767 | } else { |
| 21768 | starting_index = MAX_uint8_T; |
| 21769 | } |
| 21770 | |
| 21771 | L4_MABX_B.DataTypeConversion4_dr = starting_index; |
| 21772 | |
| 21773 | /* End of DataTypeConversion: '<S601>/Data Type Conversion4' */ |
| 21774 | |
| 21775 | /* DataTypeConversion: '<S601>/Data Type Conversion5' */ |
| 21776 | PositionFinalLimited = L4_MABX_B.SFunction1_o6_bm; |
| 21777 | if (PositionFinalLimited < 256.0) { |
| 21778 | if (PositionFinalLimited >= 0.0) { |
| 21779 | starting_index = (uint8_T)PositionFinalLimited; |
| 21780 | } else { |
| 21781 | starting_index = 0U; |
| 21782 | } |
| 21783 | } else { |
| 21784 | starting_index = MAX_uint8_T; |
| 21785 | } |
| 21786 | |
| 21787 | L4_MABX_B.DataTypeConversion5_kq = starting_index; |
| 21788 | |
| 21789 | /* End of DataTypeConversion: '<S601>/Data Type Conversion5' */ |
| 21790 | |
| 21791 | /* DataTypeConversion: '<S601>/Data Type Conversion6' */ |
| 21792 | PositionFinalLimited = L4_MABX_B.SFunction1_o7_p0; |
| 21793 | if (PositionFinalLimited < 256.0) { |
| 21794 | if (PositionFinalLimited >= 0.0) { |
| 21795 | starting_index = (uint8_T)PositionFinalLimited; |
| 21796 | } else { |
| 21797 | starting_index = 0U; |
| 21798 | } |
| 21799 | } else { |
| 21800 | starting_index = MAX_uint8_T; |
| 21801 | } |
| 21802 | |
| 21803 | L4_MABX_B.DataTypeConversion6_fx = starting_index; |
| 21804 | |
| 21805 | /* End of DataTypeConversion: '<S601>/Data Type Conversion6' */ |
| 21806 | |
| 21807 | /* DataTypeConversion: '<S601>/Data Type Conversion7' */ |
| 21808 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_j; |
| 21809 | if (PositionFinalLimited < 256.0) { |
| 21810 | if (PositionFinalLimited >= 0.0) { |
| 21811 | starting_index = (uint8_T)PositionFinalLimited; |
| 21812 | } else { |
| 21813 | starting_index = 0U; |
| 21814 | } |
| 21815 | } else { |
| 21816 | starting_index = MAX_uint8_T; |
| 21817 | } |
| 21818 | |
| 21819 | L4_MABX_B.DataTypeConversion7_b = starting_index; |
| 21820 | |
| 21821 | /* End of DataTypeConversion: '<S601>/Data Type Conversion7' */ |
| 21822 | L4_MABX_B.RawData_m[0] = L4_MABX_B.DataTypeConversion_ar; |
| 21823 | L4_MABX_B.RawData_m[1] = L4_MABX_B.DataTypeConversion1_jj; |
| 21824 | L4_MABX_B.RawData_m[2] = L4_MABX_B.DataTypeConversion2_a2z; |
| 21825 | L4_MABX_B.RawData_m[3] = L4_MABX_B.DataTypeConversion3_mn; |
| 21826 | L4_MABX_B.RawData_m[4] = L4_MABX_B.DataTypeConversion4_dr; |
| 21827 | L4_MABX_B.RawData_m[5] = L4_MABX_B.DataTypeConversion5_kq; |
| 21828 | L4_MABX_B.RawData_m[6] = L4_MABX_B.DataTypeConversion6_fx; |
| 21829 | L4_MABX_B.RawData_m[7] = L4_MABX_B.DataTypeConversion7_b; |
| 21830 | break; |
| 21831 | |
| 21832 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 21833 | /* DataTypeConversion: '<S602>/Data Type Conversion' */ |
| 21834 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_dc; |
| 21835 | if (PositionFinalLimited < 256.0) { |
| 21836 | if (PositionFinalLimited >= 0.0) { |
| 21837 | starting_index = (uint8_T)PositionFinalLimited; |
| 21838 | } else { |
| 21839 | starting_index = 0U; |
| 21840 | } |
| 21841 | } else { |
| 21842 | starting_index = MAX_uint8_T; |
| 21843 | } |
| 21844 | |
| 21845 | L4_MABX_B.DataTypeConversion_bo = starting_index; |
| 21846 | |
| 21847 | /* End of DataTypeConversion: '<S602>/Data Type Conversion' */ |
| 21848 | |
| 21849 | /* DataTypeConversion: '<S602>/Data Type Conversion1' */ |
| 21850 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_bu; |
| 21851 | if (PositionFinalLimited < 256.0) { |
| 21852 | if (PositionFinalLimited >= 0.0) { |
| 21853 | starting_index = (uint8_T)PositionFinalLimited; |
| 21854 | } else { |
| 21855 | starting_index = 0U; |
| 21856 | } |
| 21857 | } else { |
| 21858 | starting_index = MAX_uint8_T; |
| 21859 | } |
| 21860 | |
| 21861 | L4_MABX_B.DataTypeConversion1_d = starting_index; |
| 21862 | |
| 21863 | /* End of DataTypeConversion: '<S602>/Data Type Conversion1' */ |
| 21864 | |
| 21865 | /* DataTypeConversion: '<S602>/Data Type Conversion2' */ |
| 21866 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_mi; |
| 21867 | if (PositionFinalLimited < 256.0) { |
| 21868 | if (PositionFinalLimited >= 0.0) { |
| 21869 | starting_index = (uint8_T)PositionFinalLimited; |
| 21870 | } else { |
| 21871 | starting_index = 0U; |
| 21872 | } |
| 21873 | } else { |
| 21874 | starting_index = MAX_uint8_T; |
| 21875 | } |
| 21876 | |
| 21877 | L4_MABX_B.DataTypeConversion2_fk = starting_index; |
| 21878 | |
| 21879 | /* End of DataTypeConversion: '<S602>/Data Type Conversion2' */ |
| 21880 | |
| 21881 | /* DataTypeConversion: '<S602>/Data Type Conversion3' */ |
| 21882 | PositionFinalLimited = L4_MABX_B.SFunction1_o4_hm; |
| 21883 | if (PositionFinalLimited < 256.0) { |
| 21884 | if (PositionFinalLimited >= 0.0) { |
| 21885 | starting_index = (uint8_T)PositionFinalLimited; |
| 21886 | } else { |
| 21887 | starting_index = 0U; |
| 21888 | } |
| 21889 | } else { |
| 21890 | starting_index = MAX_uint8_T; |
| 21891 | } |
| 21892 | |
| 21893 | L4_MABX_B.DataTypeConversion3_en = starting_index; |
| 21894 | |
| 21895 | /* End of DataTypeConversion: '<S602>/Data Type Conversion3' */ |
| 21896 | |
| 21897 | /* DataTypeConversion: '<S602>/Data Type Conversion4' */ |
| 21898 | PositionFinalLimited = L4_MABX_B.SFunction1_o5_bl; |
| 21899 | if (PositionFinalLimited < 256.0) { |
| 21900 | if (PositionFinalLimited >= 0.0) { |
| 21901 | starting_index = (uint8_T)PositionFinalLimited; |
| 21902 | } else { |
| 21903 | starting_index = 0U; |
| 21904 | } |
| 21905 | } else { |
| 21906 | starting_index = MAX_uint8_T; |
| 21907 | } |
| 21908 | |
| 21909 | L4_MABX_B.DataTypeConversion4_g2 = starting_index; |
| 21910 | |
| 21911 | /* End of DataTypeConversion: '<S602>/Data Type Conversion4' */ |
| 21912 | |
| 21913 | /* DataTypeConversion: '<S602>/Data Type Conversion5' */ |
| 21914 | PositionFinalLimited = L4_MABX_B.SFunction1_o6_e; |
| 21915 | if (PositionFinalLimited < 256.0) { |
| 21916 | if (PositionFinalLimited >= 0.0) { |
| 21917 | starting_index = (uint8_T)PositionFinalLimited; |
| 21918 | } else { |
| 21919 | starting_index = 0U; |
| 21920 | } |
| 21921 | } else { |
| 21922 | starting_index = MAX_uint8_T; |
| 21923 | } |
| 21924 | |
| 21925 | L4_MABX_B.DataTypeConversion5_e = starting_index; |
| 21926 | |
| 21927 | /* End of DataTypeConversion: '<S602>/Data Type Conversion5' */ |
| 21928 | |
| 21929 | /* DataTypeConversion: '<S602>/Data Type Conversion6' */ |
| 21930 | PositionFinalLimited = L4_MABX_B.SFunction1_o7_cl; |
| 21931 | if (PositionFinalLimited < 256.0) { |
| 21932 | if (PositionFinalLimited >= 0.0) { |
| 21933 | starting_index = (uint8_T)PositionFinalLimited; |
| 21934 | } else { |
| 21935 | starting_index = 0U; |
| 21936 | } |
| 21937 | } else { |
| 21938 | starting_index = MAX_uint8_T; |
| 21939 | } |
| 21940 | |
| 21941 | L4_MABX_B.DataTypeConversion6_da = starting_index; |
| 21942 | |
| 21943 | /* End of DataTypeConversion: '<S602>/Data Type Conversion6' */ |
| 21944 | |
| 21945 | /* DataTypeConversion: '<S602>/Data Type Conversion7' */ |
| 21946 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_d; |
| 21947 | if (PositionFinalLimited < 256.0) { |
| 21948 | if (PositionFinalLimited >= 0.0) { |
| 21949 | starting_index = (uint8_T)PositionFinalLimited; |
| 21950 | } else { |
| 21951 | starting_index = 0U; |
| 21952 | } |
| 21953 | } else { |
| 21954 | starting_index = MAX_uint8_T; |
| 21955 | } |
| 21956 | |
| 21957 | L4_MABX_B.DataTypeConversion7_h = starting_index; |
| 21958 | |
| 21959 | /* End of DataTypeConversion: '<S602>/Data Type Conversion7' */ |
| 21960 | L4_MABX_B.RawData_m[0] = L4_MABX_B.DataTypeConversion_bo; |
| 21961 | L4_MABX_B.RawData_m[1] = L4_MABX_B.DataTypeConversion1_d; |
| 21962 | L4_MABX_B.RawData_m[2] = L4_MABX_B.DataTypeConversion2_fk; |
| 21963 | L4_MABX_B.RawData_m[3] = L4_MABX_B.DataTypeConversion3_en; |
| 21964 | L4_MABX_B.RawData_m[4] = L4_MABX_B.DataTypeConversion4_g2; |
| 21965 | L4_MABX_B.RawData_m[5] = L4_MABX_B.DataTypeConversion5_e; |
| 21966 | L4_MABX_B.RawData_m[6] = L4_MABX_B.DataTypeConversion6_da; |
| 21967 | L4_MABX_B.RawData_m[7] = L4_MABX_B.DataTypeConversion7_h; |
| 21968 | break; |
| 21969 | |
| 21970 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 21971 | L4_MABX_B.RawData_m[0] = L4_MABX_B.DataTypeConversion_ll; |
| 21972 | L4_MABX_B.RawData_m[1] = L4_MABX_B.DataTypeConversion1_ow; |
| 21973 | L4_MABX_B.RawData_m[2] = L4_MABX_B.DataTypeConversion2_nq; |
| 21974 | L4_MABX_B.RawData_m[3] = L4_MABX_B.DataTypeConversion3_dq; |
| 21975 | L4_MABX_B.RawData_m[4] = L4_MABX_B.DataTypeConversion4_j2; |
| 21976 | L4_MABX_B.RawData_m[5] = L4_MABX_B.DataTypeConversion5_gc; |
| 21977 | L4_MABX_B.RawData_m[6] = L4_MABX_B.DataTypeConversion6_m; |
| 21978 | L4_MABX_B.RawData_m[7] = L4_MABX_B.DataTypeConversion7_p; |
| 21979 | break; |
| 21980 | |
| 21981 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 21982 | L4_MABX_B.RawData_m[0] = L4_MABX_B.DataTypeConversion_ll; |
| 21983 | L4_MABX_B.RawData_m[1] = L4_MABX_B.DataTypeConversion1_ow; |
| 21984 | L4_MABX_B.RawData_m[2] = L4_MABX_B.DataTypeConversion2_nq; |
| 21985 | L4_MABX_B.RawData_m[3] = L4_MABX_B.DataTypeConversion3_dq; |
| 21986 | L4_MABX_B.RawData_m[4] = L4_MABX_B.DataTypeConversion4_j2; |
| 21987 | L4_MABX_B.RawData_m[5] = L4_MABX_B.DataTypeConversion5_gc; |
| 21988 | L4_MABX_B.RawData_m[6] = L4_MABX_B.DataTypeConversion6_m; |
| 21989 | L4_MABX_B.RawData_m[7] = L4_MABX_B.DataTypeConversion7_p; |
| 21990 | break; |
| 21991 | |
| 21992 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 21993 | L4_MABX_B.RawData_m[0] = L4_MABX_B.DataTypeConversion_ll; |
| 21994 | L4_MABX_B.RawData_m[1] = L4_MABX_B.DataTypeConversion1_ow; |
| 21995 | L4_MABX_B.RawData_m[2] = L4_MABX_B.DataTypeConversion2_nq; |
| 21996 | L4_MABX_B.RawData_m[3] = L4_MABX_B.DataTypeConversion3_dq; |
| 21997 | L4_MABX_B.RawData_m[4] = L4_MABX_B.DataTypeConversion4_j2; |
| 21998 | L4_MABX_B.RawData_m[5] = L4_MABX_B.DataTypeConversion5_gc; |
| 21999 | L4_MABX_B.RawData_m[6] = L4_MABX_B.DataTypeConversion6_m; |
| 22000 | L4_MABX_B.RawData_m[7] = L4_MABX_B.DataTypeConversion7_p; |
| 22001 | break; |
| 22002 | |
| 22003 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 22004 | L4_MABX_B.RawData_m[0] = L4_MABX_B.DataTypeConversion_ll; |
| 22005 | L4_MABX_B.RawData_m[1] = L4_MABX_B.DataTypeConversion1_ow; |
| 22006 | L4_MABX_B.RawData_m[2] = L4_MABX_B.DataTypeConversion2_nq; |
| 22007 | L4_MABX_B.RawData_m[3] = L4_MABX_B.DataTypeConversion3_dq; |
| 22008 | L4_MABX_B.RawData_m[4] = L4_MABX_B.DataTypeConversion4_j2; |
| 22009 | L4_MABX_B.RawData_m[5] = L4_MABX_B.DataTypeConversion5_gc; |
| 22010 | L4_MABX_B.RawData_m[6] = L4_MABX_B.DataTypeConversion6_m; |
| 22011 | L4_MABX_B.RawData_m[7] = L4_MABX_B.DataTypeConversion7_p; |
| 22012 | break; |
| 22013 | |
| 22014 | default: |
| 22015 | L4_MABX_B.RawData_m[0] = L4_MABX_B.DataTypeConversion_ll; |
| 22016 | L4_MABX_B.RawData_m[1] = L4_MABX_B.DataTypeConversion1_ow; |
| 22017 | L4_MABX_B.RawData_m[2] = L4_MABX_B.DataTypeConversion2_nq; |
| 22018 | L4_MABX_B.RawData_m[3] = L4_MABX_B.DataTypeConversion3_dq; |
| 22019 | L4_MABX_B.RawData_m[4] = L4_MABX_B.DataTypeConversion4_j2; |
| 22020 | L4_MABX_B.RawData_m[5] = L4_MABX_B.DataTypeConversion5_gc; |
| 22021 | L4_MABX_B.RawData_m[6] = L4_MABX_B.DataTypeConversion6_m; |
| 22022 | L4_MABX_B.RawData_m[7] = L4_MABX_B.DataTypeConversion7_p; |
| 22023 | break; |
| 22024 | } |
| 22025 | |
| 22026 | /* S-Function (sfix_bitop): '<S690>/Operator' */ |
| 22027 | L4_MABX_B.Operator_fc = (uint8_T)(L4_MABX_B.RawData_m[0] & |
| 22028 | L4_MABX_P.Operator_BitMask_m); |
| 22029 | |
| 22030 | /* DataTypeConversion: '<S690>/DataType' */ |
| 22031 | L4_MABX_B.DataType_hz = L4_MABX_B.Operator_fc; |
| 22032 | |
| 22033 | /* ArithShift: '<S683>/Shift_Arithmetic ' */ |
| 22034 | L4_MABX_B.Shift_Arithmetic_ck = (uint8_T)((uint32_T)L4_MABX_B.DataType_hz >> 1); |
| 22035 | |
| 22036 | /* DataTypeConversion: '<S683>/Data Type Conversion' */ |
| 22037 | L4_MABX_B.PropB_REAX_4_PositionIndexValid = (L4_MABX_B.Shift_Arithmetic_ck != |
| 22038 | 0); |
| 22039 | |
| 22040 | /* DataTypeConversion: '<S426>/Data Type Conversion' */ |
| 22041 | L4_MABX_B.DataTypeConversion_bi = L4_MABX_B.PropB_REAX_4_PositionIndexValid; |
| 22042 | |
| 22043 | /* S-Function (sfix_bitop): '<S689>/Operator' */ |
| 22044 | L4_MABX_B.Operator_mc = (uint8_T)(L4_MABX_B.RawData_m[0] & |
| 22045 | L4_MABX_P.Operator_BitMask_f); |
| 22046 | |
| 22047 | /* DataTypeConversion: '<S689>/DataType' */ |
| 22048 | L4_MABX_B.DataType_pb = (L4_MABX_B.Operator_mc != 0); |
| 22049 | |
| 22050 | /* DataTypeConversion: '<S426>/Data Type Conversion1' */ |
| 22051 | L4_MABX_B.DataTypeConversion1_c5 = L4_MABX_B.DataType_pb; |
| 22052 | |
| 22053 | /* S-Function (sfix_bitop): '<S691>/Operator' */ |
| 22054 | L4_MABX_B.Operator_nt = (uint8_T)(L4_MABX_B.RawData_m[0] & |
| 22055 | L4_MABX_P.Operator_BitMask_i3); |
| 22056 | |
| 22057 | /* DataTypeConversion: '<S691>/DataType' */ |
| 22058 | L4_MABX_B.DataType_fo = L4_MABX_B.Operator_nt; |
| 22059 | |
| 22060 | /* ArithShift: '<S683>/Shift_Arithmetic 1' */ |
| 22061 | L4_MABX_B.Shift_Arithmetic1_gi = (uint8_T)((uint32_T)L4_MABX_B.DataType_fo >> |
| 22062 | 2); |
| 22063 | |
| 22064 | /* DataTypeConversion: '<S683>/Data Type Conversion1' */ |
| 22065 | L4_MABX_B.PropB_REAX_4_DriverControlledEf = (L4_MABX_B.Shift_Arithmetic1_gi != |
| 22066 | 0); |
| 22067 | |
| 22068 | /* DataTypeConversion: '<S426>/Data Type Conversion2' */ |
| 22069 | L4_MABX_B.DataTypeConversion2_hs = L4_MABX_B.PropB_REAX_4_DriverControlledEf; |
| 22070 | |
| 22071 | /* SignalConversion: '<S684>/SignalConversion' */ |
| 22072 | L4_MABX_B.PropB_REAX_4_ControlOperatingMo = L4_MABX_B.RawData_m[1]; |
| 22073 | |
| 22074 | /* DataTypeConversion: '<S426>/Data Type Conversion3' */ |
| 22075 | L4_MABX_B.DataTypeConversion3_c = L4_MABX_B.PropB_REAX_4_ControlOperatingMo; |
| 22076 | |
| 22077 | /* SignalConversion: '<S685>/SignalConversion' */ |
| 22078 | L4_MABX_B.PropB_REAX_4_SystemMode = L4_MABX_B.RawData_m[2]; |
| 22079 | |
| 22080 | /* DataTypeConversion: '<S426>/Data Type Conversion4' */ |
| 22081 | L4_MABX_B.DataTypeConversion4_au = L4_MABX_B.PropB_REAX_4_SystemMode; |
| 22082 | |
| 22083 | /* DataTypeConversion: '<S686>/Data Type Conversion4' */ |
| 22084 | L4_MABX_B.DataTypeConversion4_mz = (int8_T)L4_MABX_B.RawData_m[4]; |
| 22085 | |
| 22086 | /* DataTypeConversion: '<S686>/Data Type Conversion5' */ |
| 22087 | L4_MABX_B.PropB_REAX_4_PercHandwheelTorqu = L4_MABX_B.DataTypeConversion4_mz; |
| 22088 | |
| 22089 | /* DataTypeConversion: '<S426>/Data Type Conversion5' */ |
| 22090 | L4_MABX_B.DataTypeConversion5_m = L4_MABX_B.PropB_REAX_4_PercHandwheelTorqu; |
| 22091 | |
| 22092 | /* DataTypeConversion: '<S687>/Data Type Conversion6' */ |
| 22093 | L4_MABX_B.DataTypeConversion6_h0 = L4_MABX_B.RawData_m[5]; |
| 22094 | |
| 22095 | /* DataTypeConversion: '<S687>/Data Type Conversion7' */ |
| 22096 | L4_MABX_B.DataTypeConversion7_c = L4_MABX_B.RawData_m[6]; |
| 22097 | |
| 22098 | /* ArithShift: '<S687>/Shift_Arithmetic 2' */ |
| 22099 | L4_MABX_B.Shift_Arithmetic2_p = (uint16_T)(L4_MABX_B.DataTypeConversion7_c << |
| 22100 | 8); |
| 22101 | |
| 22102 | /* S-Function (sfix_bitop): '<S692>/Operator' */ |
| 22103 | L4_MABX_B.Operator_if = (uint16_T)(L4_MABX_B.DataTypeConversion6_h0 | |
| 22104 | L4_MABX_B.Shift_Arithmetic2_p); |
| 22105 | |
| 22106 | /* DataTypeConversion: '<S692>/DataType' */ |
| 22107 | L4_MABX_B.DataType_cz = L4_MABX_B.Operator_if; |
| 22108 | |
| 22109 | /* DataTypeConversion: '<S687>/Data Type Conversion8' */ |
| 22110 | L4_MABX_B.DataTypeConversion8_b = (int16_T)L4_MABX_B.DataType_cz; |
| 22111 | |
| 22112 | /* DataTypeConversion: '<S687>/Data Type Conversion9' */ |
| 22113 | L4_MABX_B.PropB_REAX_4_AbsSteeringAngle = L4_MABX_B.DataTypeConversion8_b; |
| 22114 | |
| 22115 | /* DataTypeConversion: '<S426>/Data Type Conversion6' */ |
| 22116 | L4_MABX_B.DataTypeConversion6_b = L4_MABX_B.PropB_REAX_4_AbsSteeringAngle; |
| 22117 | |
| 22118 | /* DataTypeConversion: '<S688>/Data Type Conversion10' */ |
| 22119 | L4_MABX_B.DataTypeConversion10_fy = (int8_T)L4_MABX_B.RawData_m[7]; |
| 22120 | |
| 22121 | /* DataTypeConversion: '<S688>/Data Type Conversion11' */ |
| 22122 | L4_MABX_B.PropB_REAX_4_PercMotorTorque = L4_MABX_B.DataTypeConversion10_fy; |
| 22123 | |
| 22124 | /* DataTypeConversion: '<S426>/Data Type Conversion7' */ |
| 22125 | L4_MABX_B.DataTypeConversion7_l = L4_MABX_B.PropB_REAX_4_PercMotorTorque; |
| 22126 | |
| 22127 | /* DataTypeConversion: '<S603>/Data Type Conversion8' */ |
| 22128 | L4_MABX_B.RX_status_g3 = (L4_MABX_B.SFunction1_o9_h != 0.0); |
| 22129 | |
| 22130 | /* MultiPortSwitch: '<S451>/Multiport_Switch' incorporates: |
| 22131 | * Constant: '<S451>/Constant' |
| 22132 | */ |
| 22133 | switch (PROPB_REAX_CHANNEL_APV) { |
| 22134 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 22135 | /* DataTypeConversion: '<S601>/Data Type Conversion8' */ |
| 22136 | L4_MABX_B.RX_status_b5 = (L4_MABX_B.SFunction1_o9_e != 0.0); |
| 22137 | L4_MABX_B.RX_status_ni = L4_MABX_B.RX_status_b5; |
| 22138 | break; |
| 22139 | |
| 22140 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 22141 | /* DataTypeConversion: '<S602>/Data Type Conversion8' */ |
| 22142 | L4_MABX_B.RX_status_io = (L4_MABX_B.SFunction1_o9_o != 0.0); |
| 22143 | L4_MABX_B.RX_status_ni = L4_MABX_B.RX_status_io; |
| 22144 | break; |
| 22145 | |
| 22146 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 22147 | L4_MABX_B.RX_status_ni = L4_MABX_B.RX_status_g3; |
| 22148 | break; |
| 22149 | |
| 22150 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 22151 | L4_MABX_B.RX_status_ni = L4_MABX_B.RX_status_g3; |
| 22152 | break; |
| 22153 | |
| 22154 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 22155 | L4_MABX_B.RX_status_ni = L4_MABX_B.RX_status_g3; |
| 22156 | break; |
| 22157 | |
| 22158 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 22159 | L4_MABX_B.RX_status_ni = L4_MABX_B.RX_status_g3; |
| 22160 | break; |
| 22161 | |
| 22162 | default: |
| 22163 | L4_MABX_B.RX_status_ni = L4_MABX_B.RX_status_g3; |
| 22164 | break; |
| 22165 | } |
| 22166 | |
| 22167 | /* DataTypeConversion: '<S603>/Data Type Conversion9' */ |
| 22168 | L4_MABX_B.RX_time_c4 = L4_MABX_B.SFunction1_o10_c; |
| 22169 | |
| 22170 | /* MultiPortSwitch: '<S451>/Multiport_Switch' incorporates: |
| 22171 | * Constant: '<S451>/Constant' |
| 22172 | */ |
| 22173 | switch (PROPB_REAX_CHANNEL_APV) { |
| 22174 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 22175 | /* DataTypeConversion: '<S601>/Data Type Conversion9' */ |
| 22176 | L4_MABX_B.RX_time_b2 = L4_MABX_B.SFunction1_o10_a; |
| 22177 | L4_MABX_B.RX_time_pm = L4_MABX_B.RX_time_b2; |
| 22178 | break; |
| 22179 | |
| 22180 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 22181 | /* DataTypeConversion: '<S602>/Data Type Conversion9' */ |
| 22182 | L4_MABX_B.RX_time_ic = L4_MABX_B.SFunction1_o10_p; |
| 22183 | L4_MABX_B.RX_time_pm = L4_MABX_B.RX_time_ic; |
| 22184 | break; |
| 22185 | |
| 22186 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 22187 | L4_MABX_B.RX_time_pm = L4_MABX_B.RX_time_c4; |
| 22188 | break; |
| 22189 | |
| 22190 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 22191 | L4_MABX_B.RX_time_pm = L4_MABX_B.RX_time_c4; |
| 22192 | break; |
| 22193 | |
| 22194 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 22195 | L4_MABX_B.RX_time_pm = L4_MABX_B.RX_time_c4; |
| 22196 | break; |
| 22197 | |
| 22198 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 22199 | L4_MABX_B.RX_time_pm = L4_MABX_B.RX_time_c4; |
| 22200 | break; |
| 22201 | |
| 22202 | default: |
| 22203 | L4_MABX_B.RX_time_pm = L4_MABX_B.RX_time_c4; |
| 22204 | break; |
| 22205 | } |
| 22206 | |
| 22207 | /* DataTypeConversion: '<S603>/Data Type Conversion10' */ |
| 22208 | L4_MABX_B.RX_delta_time_hc = L4_MABX_B.SFunction1_o11_a; |
| 22209 | |
| 22210 | /* MultiPortSwitch: '<S451>/Multiport_Switch' incorporates: |
| 22211 | * Constant: '<S451>/Constant' |
| 22212 | */ |
| 22213 | switch (PROPB_REAX_CHANNEL_APV) { |
| 22214 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 22215 | /* DataTypeConversion: '<S601>/Data Type Conversion10' */ |
| 22216 | L4_MABX_B.RX_delta_time_f = L4_MABX_B.SFunction1_o11_f; |
| 22217 | L4_MABX_B.RX_delta_time_bo = L4_MABX_B.RX_delta_time_f; |
| 22218 | break; |
| 22219 | |
| 22220 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 22221 | /* DataTypeConversion: '<S602>/Data Type Conversion10' */ |
| 22222 | L4_MABX_B.RX_delta_time_mv = L4_MABX_B.SFunction1_o11_g; |
| 22223 | L4_MABX_B.RX_delta_time_bo = L4_MABX_B.RX_delta_time_mv; |
| 22224 | break; |
| 22225 | |
| 22226 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 22227 | L4_MABX_B.RX_delta_time_bo = L4_MABX_B.RX_delta_time_hc; |
| 22228 | break; |
| 22229 | |
| 22230 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 22231 | L4_MABX_B.RX_delta_time_bo = L4_MABX_B.RX_delta_time_hc; |
| 22232 | break; |
| 22233 | |
| 22234 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 22235 | L4_MABX_B.RX_delta_time_bo = L4_MABX_B.RX_delta_time_hc; |
| 22236 | break; |
| 22237 | |
| 22238 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 22239 | L4_MABX_B.RX_delta_time_bo = L4_MABX_B.RX_delta_time_hc; |
| 22240 | break; |
| 22241 | |
| 22242 | default: |
| 22243 | L4_MABX_B.RX_delta_time_bo = L4_MABX_B.RX_delta_time_hc; |
| 22244 | break; |
| 22245 | } |
| 22246 | |
| 22247 | /* RelationalOperator: '<S610>/Operator' incorporates: |
| 22248 | * Constant: '<S451>/Constant' |
| 22249 | * Constant: '<S604>/Constant2' |
| 22250 | */ |
| 22251 | L4_MABX_B.Operator_ft = (PROPB_REAX_CHANNEL_APV == |
| 22252 | L4_MABX_P.Constant2_Value_gx); |
| 22253 | |
| 22254 | /* RelationalOperator: '<S611>/Operator' incorporates: |
| 22255 | * Constant: '<S451>/Constant' |
| 22256 | * Constant: '<S604>/Constant3' |
| 22257 | */ |
| 22258 | L4_MABX_B.Operator_f21 = (PROPB_REAX_CHANNEL_APV == |
| 22259 | L4_MABX_P.Constant3_Value_k); |
| 22260 | |
| 22261 | /* RelationalOperator: '<S612>/Operator' incorporates: |
| 22262 | * Constant: '<S451>/Constant' |
| 22263 | * Constant: '<S604>/Constant4' |
| 22264 | */ |
| 22265 | L4_MABX_B.Operator_ev0 = (PROPB_REAX_CHANNEL_APV == |
| 22266 | L4_MABX_P.Constant4_Value_a); |
| 22267 | |
| 22268 | /* S-Function (rti_commonblock): '<S466>/S-Function1' */ |
| 22269 | /* This comment workarounds a code generation problem */ |
| 22270 | |
| 22271 | /* S-Function (rti_commonblock): '<S467>/S-Function1' */ |
| 22272 | /* This comment workarounds a code generation problem */ |
| 22273 | |
| 22274 | /* S-Function (rti_commonblock): '<S468>/S-Function1' */ |
| 22275 | /* This comment workarounds a code generation problem */ |
| 22276 | |
| 22277 | /* S-Function (rti_commonblock): '<S469>/S-Function1' */ |
| 22278 | /* This comment workarounds a code generation problem */ |
| 22279 | |
| 22280 | /* S-Function (rti_commonblock): '<S470>/S-Function1' */ |
| 22281 | /* This comment workarounds a code generation problem */ |
| 22282 | |
| 22283 | /* S-Function (rti_commonblock): '<S471>/S-Function1' */ |
| 22284 | /* This comment workarounds a code generation problem */ |
| 22285 | |
| 22286 | /* S-Function (rti_commonblock): '<S743>/S-Function1' */ |
| 22287 | /* This comment workarounds a code generation problem */ |
| 22288 | |
| 22289 | /* DataTypeConversion: '<S422>/LogPbActive' */ |
| 22290 | L4_MABX_B.LogPbActive = L4_MABX_B.SFunction1_g; |
| 22291 | |
| 22292 | /* Logic: '<S422>/Logical Operator2' */ |
| 22293 | L4_MABX_B.LogicalOperator2_l = !L4_MABX_B.LogPbActive; |
| 22294 | |
| 22295 | /* RelationalOperator: '<S757>/Compare' incorporates: |
| 22296 | * Constant: '<S757>/Constant' |
| 22297 | */ |
| 22298 | L4_MABX_B.Compare_ai = ((int32_T)L4_MABX_B.LogicalOperator2_l > (int32_T) |
| 22299 | L4_MABX_P.Constant_Value_lq); |
| 22300 | |
| 22301 | /* UnitDelay: '<S753>/Delay Input1' */ |
| 22302 | L4_MABX_B.Uk1_kx = L4_MABX_DW.DelayInput1_DSTATE_l; |
| 22303 | |
| 22304 | /* RelationalOperator: '<S753>/FixPt Relational Operator' */ |
| 22305 | L4_MABX_B.FixPtRelationalOperator_f = ((int32_T)L4_MABX_B.Compare_ai > |
| 22306 | (int32_T)L4_MABX_B.Uk1_kx); |
| 22307 | |
| 22308 | /* UnitDelay: '<S754>/Unit Delay' */ |
| 22309 | L4_MABX_B.UnitDelay_c = L4_MABX_DW.UnitDelay_DSTATE_j; |
| 22310 | |
| 22311 | /* UnitDelay: '<S748>/Unit Delay' */ |
| 22312 | L4_MABX_B.UnitDelay_os = L4_MABX_DW.UnitDelay_DSTATE_cq; |
| 22313 | |
| 22314 | /* RelationalOperator: '<S756>/Compare' incorporates: |
| 22315 | * Constant: '<S756>/Constant' |
| 22316 | */ |
| 22317 | L4_MABX_B.Compare_b = ((int32_T)L4_MABX_B.UnitDelay_os <= (int32_T) |
| 22318 | L4_MABX_P.Constant_Value_eyi); |
| 22319 | |
| 22320 | /* UnitDelay: '<S752>/Delay Input1' */ |
| 22321 | L4_MABX_B.Uk1_i = L4_MABX_DW.DelayInput1_DSTATE_c; |
| 22322 | |
| 22323 | /* RelationalOperator: '<S752>/FixPt Relational Operator' */ |
| 22324 | L4_MABX_B.FixPtRelationalOperator_no = ((int32_T)L4_MABX_B.Compare_b > |
| 22325 | (int32_T)L4_MABX_B.Uk1_i); |
| 22326 | |
| 22327 | /* UnitDelay: '<S754>/Unit Delay1' */ |
| 22328 | L4_MABX_B.UnitDelay1_co = L4_MABX_DW.UnitDelay1_DSTATE_n; |
| 22329 | |
| 22330 | /* Logic: '<S754>/OR1' */ |
| 22331 | L4_MABX_B.OR1_mk = (L4_MABX_B.FixPtRelationalOperator_no || |
| 22332 | L4_MABX_B.UnitDelay1_co); |
| 22333 | |
| 22334 | /* Switch: '<S754>/Switch' incorporates: |
| 22335 | * Constant: '<S754>/Constant0' |
| 22336 | */ |
| 22337 | if (L4_MABX_B.OR1_mk) { |
| 22338 | /* Sum: '<S754>/Sum' incorporates: |
| 22339 | * Constant: '<S754>/Constant1' |
| 22340 | */ |
| 22341 | L4_MABX_B.Sum_b = L4_MABX_B.UnitDelay_c + L4_MABX_P.Constant1_Value_ma; |
| 22342 | L4_MABX_B.Switch_m = L4_MABX_B.Sum_b; |
| 22343 | } else { |
| 22344 | L4_MABX_B.Switch_m = L4_MABX_P.Constant0_Value_n; |
| 22345 | } |
| 22346 | |
| 22347 | /* End of Switch: '<S754>/Switch' */ |
| 22348 | |
| 22349 | /* RelationalOperator: '<S758>/Compare' incorporates: |
| 22350 | * Constant: '<S758>/Constant' |
| 22351 | */ |
| 22352 | L4_MABX_B.Compare_mn = (L4_MABX_B.Switch_m > L4_MABX_P.Constant_Value_i4); |
| 22353 | |
| 22354 | /* Gain: '<S754>/Gain' incorporates: |
| 22355 | * Constant: '<S422>/Constant1' |
| 22356 | */ |
| 22357 | L4_MABX_B.Gain_f = L4_MABX_P.Gain_Gain_f3 * L4_MABX_P.Constant1_Value_fq; |
| 22358 | |
| 22359 | /* RelationalOperator: '<S754>/LessThanOrEqual' */ |
| 22360 | L4_MABX_B.LessThanOrEqual_i = (L4_MABX_B.Switch_m <= L4_MABX_B.Gain_f); |
| 22361 | |
| 22362 | /* Logic: '<S754>/AND' */ |
| 22363 | L4_MABX_B.AND_d = (L4_MABX_B.Compare_mn && L4_MABX_B.LessThanOrEqual_i); |
| 22364 | |
| 22365 | /* Logic: '<S748>/NOT' */ |
| 22366 | L4_MABX_B.NOT_k = !L4_MABX_B.AND_d; |
| 22367 | |
| 22368 | /* Logic: '<S748>/AND' */ |
| 22369 | L4_MABX_B.AND_d2 = (L4_MABX_B.FixPtRelationalOperator_f && L4_MABX_B.NOT_k); |
| 22370 | |
| 22371 | /* UnitDelay: '<S755>/Unit Delay' */ |
| 22372 | L4_MABX_B.UnitDelay_m = L4_MABX_DW.UnitDelay_DSTATE_is; |
| 22373 | |
| 22374 | /* UnitDelay: '<S755>/Unit Delay1' */ |
| 22375 | L4_MABX_B.UnitDelay1_i = L4_MABX_DW.UnitDelay1_DSTATE_pn; |
| 22376 | |
| 22377 | /* Logic: '<S755>/OR1' */ |
| 22378 | L4_MABX_B.OR1_k = (L4_MABX_B.AND_d2 || L4_MABX_B.UnitDelay1_i); |
| 22379 | |
| 22380 | /* Switch: '<S755>/Switch' incorporates: |
| 22381 | * Constant: '<S755>/Constant0' |
| 22382 | */ |
| 22383 | if (L4_MABX_B.OR1_k) { |
| 22384 | /* Sum: '<S755>/Sum' incorporates: |
| 22385 | * Constant: '<S755>/Constant1' |
| 22386 | */ |
| 22387 | L4_MABX_B.Sum_g = L4_MABX_B.UnitDelay_m + L4_MABX_P.Constant1_Value_eu; |
| 22388 | L4_MABX_B.Switch_h = L4_MABX_B.Sum_g; |
| 22389 | } else { |
| 22390 | L4_MABX_B.Switch_h = L4_MABX_P.Constant0_Value_l; |
| 22391 | } |
| 22392 | |
| 22393 | /* End of Switch: '<S755>/Switch' */ |
| 22394 | |
| 22395 | /* RelationalOperator: '<S759>/Compare' incorporates: |
| 22396 | * Constant: '<S759>/Constant' |
| 22397 | */ |
| 22398 | L4_MABX_B.Compare_bm = (L4_MABX_B.Switch_h > L4_MABX_P.Constant_Value_m4); |
| 22399 | |
| 22400 | /* Gain: '<S755>/Gain' incorporates: |
| 22401 | * Constant: '<S422>/Constant' |
| 22402 | */ |
| 22403 | L4_MABX_B.Gain_f1 = L4_MABX_P.Gain_Gain_ph * L4_MABX_P.Constant_Value_ey; |
| 22404 | |
| 22405 | /* RelationalOperator: '<S755>/LessThanOrEqual' */ |
| 22406 | L4_MABX_B.LessThanOrEqual_j = (L4_MABX_B.Switch_h <= L4_MABX_B.Gain_f1); |
| 22407 | |
| 22408 | /* Logic: '<S755>/AND' */ |
| 22409 | L4_MABX_B.AND_j = (L4_MABX_B.Compare_bm && L4_MABX_B.LessThanOrEqual_j); |
| 22410 | |
| 22411 | /* Logic: '<S748>/AND2' */ |
| 22412 | LogEventPB = (L4_MABX_B.AND_j && L4_MABX_B.NOT_k); |
| 22413 | |
| 22414 | /* Assertion: '<S789>/Assertion' */ |
| 22415 | utAssert(L4_MABX_B.conjunction_p); |
| 22416 | |
| 22417 | /* Assertion: '<S797>/Assertion' */ |
| 22418 | utAssert(L4_MABX_B.conjunction); |
| 22419 | |
| 22420 | /* Assertion: '<S805>/Assertion' */ |
| 22421 | utAssert(L4_MABX_B.conjunction_d); |
| 22422 | |
| 22423 | /* Assertion: '<S813>/Assertion' */ |
| 22424 | utAssert(L4_MABX_B.conjunction_f); |
| 22425 | |
| 22426 | /* Assertion: '<S821>/Assertion' */ |
| 22427 | utAssert(L4_MABX_B.conjunction_h); |
| 22428 | |
| 22429 | /* RelationalOperator: '<S788>/Relational Operator9' incorporates: |
| 22430 | * Constant: '<S769>/PWMSynchFaultLimMin' |
| 22431 | */ |
| 22432 | L4_MABX_B.F_Fault_Soft_cn = (L4_MABX_B.If_Then_Else_j.Switch != |
| 22433 | L4_MABX_P.PWMSynchFaultLimMin_Value); |
| 22434 | |
| 22435 | /* Gain: '<S422>/ShifterControlFreq' */ |
| 22436 | L4_MABX_B.ShiftControlFreq = L4_MABX_P.ShifterControlFreq_Gain * |
| 22437 | L4_MABX_B.SFunction1_o1_f; |
| 22438 | |
| 22439 | /* S-Function (rti_commonblock): '<S736>/S-Function1' */ |
| 22440 | /* This comment workarounds a code generation problem */ |
| 22441 | { |
| 22442 | /* dSPACE I/O Board DS1401STDADCT4 #1 Unit:ADC Group:ADC */ |
| 22443 | adc_tp4_single_new_read(ADC_TP4_1_MODULE_ADDR, |
| 22444 | ADC_TP4_CH2, |
| 22445 | (dsfloat *)&L4_MABX_B.SFunction1_n); |
| 22446 | } |
| 22447 | |
| 22448 | /* Gain: '<S422>/ShifterControlDC2' */ |
| 22449 | L4_MABX_B.ShifterControlDC2 = L4_MABX_P.ShifterControlDC2_Gain * |
| 22450 | L4_MABX_B.SFunction1_n; |
| 22451 | |
| 22452 | /* S-Function (rti_commonblock): '<S737>/S-Function1' */ |
| 22453 | /* This comment workarounds a code generation problem */ |
| 22454 | { |
| 22455 | /* dSPACE I/O Board DS1401STDADCT4 #1 Unit:ADC Group:ADC */ |
| 22456 | adc_tp4_single_new_read(ADC_TP4_1_MODULE_ADDR, |
| 22457 | ADC_TP4_CH1, |
| 22458 | (dsfloat *)&L4_MABX_B.SFunction1_b); |
| 22459 | } |
| 22460 | |
| 22461 | /* Gain: '<S422>/ShifterControlDC1' */ |
| 22462 | L4_MABX_B.ShifterControlDC1 = L4_MABX_P.ShifterControlDC1_Gain * |
| 22463 | L4_MABX_B.SFunction1_b; |
| 22464 | |
| 22465 | /* S-Function (rti_commonblock): '<S8>/S-Function1' */ |
| 22466 | /* This comment workarounds a code generation problem */ |
| 22467 | |
| 22468 | /* S-Function (rti_commonblock): '<S9>/S-Function1' */ |
| 22469 | /* This comment workarounds a code generation problem */ |
| 22470 | |
| 22471 | /* UnitDelay: '<S10>/Unit_Delay' */ |
| 22472 | L4_MABX_B.Unit_Delay_jj = L4_MABX_DW.Unit_Delay_DSTATE_do; |
| 22473 | |
| 22474 | /* Outputs for Enabled SubSystem: '<S10>/EnabledSubsystem' incorporates: |
| 22475 | * EnablePort: '<S1096>/Enable' |
| 22476 | */ |
| 22477 | if (L4_MABX_B.Unit_Delay_jj) { |
| 22478 | /* Constant: '<S1096>/Constant' */ |
| 22479 | memcpy(&GLB_SWVERSION_CPV_[0], &L4_MABX_P.GLB_SWVERSION_CPV[0], 100U * |
| 22480 | sizeof(uint8_T)); |
| 22481 | } |
| 22482 | |
| 22483 | /* End of Outputs for SubSystem: '<S10>/EnabledSubsystem' */ |
| 22484 | /* user code (Output function Trailer for TID0) */ |
| 22485 | |
| 22486 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 22487 | /* EventChannel: 0 */ |
| 22488 | if (tid == 0) { |
| 22489 | DSXCP_service(0); |
| 22490 | } |
| 22491 | |
| 22492 | /* If subsystem generates rate grouping Output functions, |
| 22493 | * when tid is used in Output function for one rate, |
| 22494 | * all Output functions include tid as a local variable. |
| 22495 | * As result, some Output functions may have unused tid. |
| 22496 | */ |
| 22497 | UNUSED_PARAMETER(tid); |
| 22498 | } |
| 22499 | |
| 22500 | /* Model update function for TID0 */ |
| 22501 | void L4_MABX_update0(void) /* Sample time: [0.01s, 0.0s] */ |
| 22502 | { |
| 22503 | int32_T i; |
| 22504 | |
| 22505 | /* Update for UnitDelay: '<S763>/Unit Delay' */ |
| 22506 | L4_MABX_DW.UnitDelay_DSTATE = L4_MABX_B.Switch_j; |
| 22507 | |
| 22508 | /* Update for UnitDelay: '<S761>/Delay Input1' */ |
| 22509 | L4_MABX_DW.DelayInput1_DSTATE_i = L4_MABX_B.Compare; |
| 22510 | |
| 22511 | /* Update for UnitDelay: '<S762>/Unit Delay' */ |
| 22512 | L4_MABX_DW.UnitDelay_DSTATE_i = L4_MABX_B.Switch; |
| 22513 | |
| 22514 | /* Update for UnitDelay: '<S749>/Unit Delay' */ |
| 22515 | L4_MABX_DW.UnitDelay_DSTATE_ix = L4_MABX_B.AND_i; |
| 22516 | |
| 22517 | /* Update for UnitDelay: '<S760>/Delay Input1' */ |
| 22518 | L4_MABX_DW.DelayInput1_DSTATE_i5 = L4_MABX_B.Compare_p; |
| 22519 | |
| 22520 | /* Update for UnitDelay: '<S762>/Unit Delay1' */ |
| 22521 | L4_MABX_DW.UnitDelay1_DSTATE_p = L4_MABX_B.AND; |
| 22522 | |
| 22523 | /* Update for UnitDelay: '<S763>/Unit Delay1' */ |
| 22524 | L4_MABX_DW.UnitDelay1_DSTATE_h = L4_MABX_B.AND_i; |
| 22525 | |
| 22526 | /* Update for UnitDelay: '<S802>/FixPt Unit Delay2' incorporates: |
| 22527 | * Constant: '<S802>/FixPt Constant' |
| 22528 | */ |
| 22529 | L4_MABX_DW.FixPtUnitDelay2_DSTATE = L4_MABX_P.FixPtConstant_Value_nv; |
| 22530 | |
| 22531 | /* Update for UnitDelay: '<S802>/FixPt Unit Delay1' */ |
| 22532 | L4_MABX_DW.FixPtUnitDelay1_DSTATE = L4_MABX_B.If_Then_Else_a.Switch; |
| 22533 | |
| 22534 | /* Update for UnitDelay: '<S794>/FixPt Unit Delay2' incorporates: |
| 22535 | * Constant: '<S794>/FixPt Constant' |
| 22536 | */ |
| 22537 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_d = L4_MABX_P.FixPtConstant_Value_l; |
| 22538 | |
| 22539 | /* Update for UnitDelay: '<S794>/FixPt Unit Delay1' */ |
| 22540 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_d = L4_MABX_B.If_Then_Else_h.Switch; |
| 22541 | |
| 22542 | /* Update for UnitDelay: '<S818>/FixPt Unit Delay2' incorporates: |
| 22543 | * Constant: '<S818>/FixPt Constant' |
| 22544 | */ |
| 22545 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_a = L4_MABX_P.FixPtConstant_Value_od; |
| 22546 | |
| 22547 | /* Update for UnitDelay: '<S818>/FixPt Unit Delay1' */ |
| 22548 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g = L4_MABX_B.If_Then_Else_p.Switch; |
| 22549 | |
| 22550 | /* Update for UnitDelay: '<S810>/FixPt Unit Delay2' incorporates: |
| 22551 | * Constant: '<S810>/FixPt Constant' |
| 22552 | */ |
| 22553 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_i = L4_MABX_P.FixPtConstant_Value_kl; |
| 22554 | |
| 22555 | /* Update for UnitDelay: '<S810>/FixPt Unit Delay1' */ |
| 22556 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_e = L4_MABX_B.If_Then_Else_k.Switch; |
| 22557 | |
| 22558 | /* Update for UnitDelay: '<S772>/Unit_Delay' incorporates: |
| 22559 | * Constant: '<S772>/Constant' |
| 22560 | */ |
| 22561 | L4_MABX_DW.Unit_Delay_DSTATE_pw = L4_MABX_P.Constant_Value_la; |
| 22562 | |
| 22563 | /* Update for UnitDelay: '<S839>/Unit_Delay1' incorporates: |
| 22564 | * Constant: '<S839>/Constant' |
| 22565 | */ |
| 22566 | L4_MABX_DW.Unit_Delay1_DSTATE = L4_MABX_P.Constant_Value_e4; |
| 22567 | |
| 22568 | /* Update for UnitDelay: '<S839>/Unit_Delay2' */ |
| 22569 | L4_MABX_DW.Unit_Delay2_DSTATE = L4_MABX_B.If_Then_Else_i.Switch; |
| 22570 | |
| 22571 | /* Update for UnitDelay: '<S772>/Unit_Delay1' incorporates: |
| 22572 | * Constant: '<S772>/Constant1' |
| 22573 | */ |
| 22574 | L4_MABX_DW.Unit_Delay1_DSTATE_m = L4_MABX_P.Constant1_Value_pd; |
| 22575 | |
| 22576 | /* Update for UnitDelay: '<S840>/Unit_Delay1' incorporates: |
| 22577 | * Constant: '<S840>/Constant' |
| 22578 | */ |
| 22579 | L4_MABX_DW.Unit_Delay1_DSTATE_p = L4_MABX_P.Constant_Value_ah1; |
| 22580 | |
| 22581 | /* Update for UnitDelay: '<S840>/Unit_Delay2' */ |
| 22582 | L4_MABX_DW.Unit_Delay2_DSTATE_g = L4_MABX_B.If_Then_Else_b.Switch; |
| 22583 | |
| 22584 | /* Update for UnitDelay: '<S838>/FixPt Unit Delay2' incorporates: |
| 22585 | * Constant: '<S838>/FixPt Constant' |
| 22586 | */ |
| 22587 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_d1 = L4_MABX_P.FixPtConstant_Value_l1; |
| 22588 | |
| 22589 | /* Update for UnitDelay: '<S838>/FixPt Unit Delay1' */ |
| 22590 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_n = L4_MABX_B.If_Then_Else3_c.Switch; |
| 22591 | |
| 22592 | /* Update for UnitDelay: '<S837>/FixPt Unit Delay2' incorporates: |
| 22593 | * Constant: '<S837>/FixPt Constant' |
| 22594 | */ |
| 22595 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_g = L4_MABX_P.FixPtConstant_Value_na; |
| 22596 | |
| 22597 | /* Update for UnitDelay: '<S837>/FixPt Unit Delay1' */ |
| 22598 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_j = L4_MABX_B.If_Then_Else1_c.Switch; |
| 22599 | |
| 22600 | /* Update for UnitDelay: '<S826>/FixPt Unit Delay2' incorporates: |
| 22601 | * Constant: '<S826>/FixPt Constant' |
| 22602 | */ |
| 22603 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_k = L4_MABX_P.FixPtConstant_Value_c; |
| 22604 | |
| 22605 | /* Update for UnitDelay: '<S826>/FixPt Unit Delay1' */ |
| 22606 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_e5 = L4_MABX_B.If_Then_Else_j.Switch; |
| 22607 | |
| 22608 | /* Update for Enabled SubSystem: '<S750>/Slew_at_event' incorporates: |
| 22609 | * EnablePort: '<S773>/Enable' |
| 22610 | */ |
| 22611 | if (L4_MABX_DW.Slew_at_event_MODE) { |
| 22612 | /* Update for UnitDelay: '<S844>/Unit_Delay' */ |
| 22613 | L4_MABX_DW.Unit_Delay_DSTATE_jr = L4_MABX_B.LogicalOperator6_o; |
| 22614 | |
| 22615 | /* Update for UnitDelay: '<S845>/Unit_Delay' incorporates: |
| 22616 | * Constant: '<S845>/Constant' |
| 22617 | */ |
| 22618 | L4_MABX_DW.Unit_Delay_DSTATE_jz = L4_MABX_P.Constant_Value_b5; |
| 22619 | |
| 22620 | /* Update for UnitDelay: '<S848>/FixPt Unit Delay2' incorporates: |
| 22621 | * Constant: '<S848>/FixPt Constant' |
| 22622 | */ |
| 22623 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_b = L4_MABX_P.FixPtConstant_Value_ga; |
| 22624 | |
| 22625 | /* Update for UnitDelay: '<S848>/FixPt Unit Delay1' */ |
| 22626 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_o = L4_MABX_B.If_Then_Else_or.Switch; |
| 22627 | |
| 22628 | /* Update for UnitDelay: '<S843>/Unit_Delay' */ |
| 22629 | L4_MABX_DW.Unit_Delay_DSTATE_hg = L4_MABX_B.LogicalOperator_np; |
| 22630 | } |
| 22631 | |
| 22632 | /* End of Update for SubSystem: '<S750>/Slew_at_event' */ |
| 22633 | |
| 22634 | /* Update for Enabled SubSystem: '<S442>/CAN_RX_EC1_00' incorporates: |
| 22635 | * EnablePort: '<S526>/Enable' |
| 22636 | */ |
| 22637 | if (L4_MABX_B.LogicalOperator_iz) { |
| 22638 | /* Update for UnitDelay: '<S526>/Unit Delay' */ |
| 22639 | for (i = 0; i < 39; i++) { |
| 22640 | L4_MABX_DW.UnitDelay_DSTATE_b3[i] = L4_MABX_B.Data_d[i]; |
| 22641 | } |
| 22642 | |
| 22643 | /* End of Update for UnitDelay: '<S526>/Unit Delay' */ |
| 22644 | |
| 22645 | /* Update for Enabled SubSystem: '<S526>/Decode' incorporates: |
| 22646 | * EnablePort: '<S529>/Enable' |
| 22647 | */ |
| 22648 | if (L4_MABX_B.RX_status_pz) { |
| 22649 | /* Update for UnitDelay: '<S529>/Unit_Delay' */ |
| 22650 | L4_MABX_DW.Unit_Delay_DSTATE_i = L4_MABX_B.timeStamp_j; |
| 22651 | } |
| 22652 | |
| 22653 | /* End of Update for SubSystem: '<S526>/Decode' */ |
| 22654 | } |
| 22655 | |
| 22656 | /* End of Update for SubSystem: '<S442>/CAN_RX_EC1_00' */ |
| 22657 | |
| 22658 | /* Update for UnitDelay: '<S655>/Unit_Delay3' */ |
| 22659 | L4_MABX_DW.Unit_Delay3_DSTATE = L4_MABX_B.LogicalOperator2_a; |
| 22660 | |
| 22661 | /* Update for Enabled SubSystem: '<S465>/CAN_RX_VI_00' incorporates: |
| 22662 | * EnablePort: '<S654>/Enable' |
| 22663 | */ |
| 22664 | if (L4_MABX_B.LogicalOperator_im) { |
| 22665 | /* Update for UnitDelay: '<S654>/Unit Delay' */ |
| 22666 | for (i = 0; i < 17; i++) { |
| 22667 | L4_MABX_DW.UnitDelay_DSTATE_o[i] = L4_MABX_B.Data[i]; |
| 22668 | } |
| 22669 | |
| 22670 | /* End of Update for UnitDelay: '<S654>/Unit Delay' */ |
| 22671 | |
| 22672 | /* Update for Enabled SubSystem: '<S654>/Decode' incorporates: |
| 22673 | * EnablePort: '<S657>/Enable' |
| 22674 | */ |
| 22675 | if (L4_MABX_B.RX_status_bk) { |
| 22676 | /* Update for UnitDelay: '<S657>/Unit_Delay' */ |
| 22677 | L4_MABX_DW.Unit_Delay_DSTATE_d = L4_MABX_B.timeStamp; |
| 22678 | } |
| 22679 | |
| 22680 | /* End of Update for SubSystem: '<S654>/Decode' */ |
| 22681 | } |
| 22682 | |
| 22683 | /* End of Update for SubSystem: '<S465>/CAN_RX_VI_00' */ |
| 22684 | |
| 22685 | /* Update for UnitDelay: '<S655>/Unit_Delay' incorporates: |
| 22686 | * Constant: '<S655>/Constant' |
| 22687 | */ |
| 22688 | L4_MABX_DW.Unit_Delay_DSTATE_h1 = L4_MABX_P.Constant_Value_fw; |
| 22689 | |
| 22690 | /* Update for UnitDelay: '<S661>/Unit_Delay' */ |
| 22691 | L4_MABX_DW.Unit_Delay_DSTATE_fr = L4_MABX_B.LogicalOperator1_c; |
| 22692 | |
| 22693 | /* Update for UnitDelay: '<S3>/Unit_Delay' */ |
| 22694 | L4_MABX_DW.Unit_Delay_80_DSTATE = EStop; |
| 22695 | L4_MABX_DW.Unit_Delay_81_DSTATE = EnableSw; |
| 22696 | L4_MABX_DW.Unit_Delay_48_DSTATE = L4_MABX_B.AND_a; |
| 22697 | L4_MABX_DW.Unit_Delay_83_DSTATE = LogEventPB; |
| 22698 | L4_MABX_DW.Unit_Delay_45_DSTATE = L4_MABX_B.AutonomousEnabled_d; |
| 22699 | L4_MABX_DW.Unit_Delay_47_DSTATE = MABX_Mode; |
| 22700 | L4_MABX_DW.Unit_Delay_84_DSTATE = BrakeSW; |
| 22701 | |
| 22702 | /* Update for UnitDelay: '<S411>/Delay Input1' */ |
| 22703 | L4_MABX_DW.DelayInput1_DSTATE_n = L4_MABX_B.Compare_c; |
| 22704 | |
| 22705 | /* Update for UnitDelay: '<S409>/Unit Delay' */ |
| 22706 | L4_MABX_DW.UnitDelay_DSTATE_k = L4_MABX_B.Count; |
| 22707 | |
| 22708 | /* Update for Atomic SubSystem: '<S65>/Task_10ms' */ |
| 22709 | /* Update for UnitDelay: '<S97>/Unit Delay1' */ |
| 22710 | L4_MABX_DW.UnitDelay1_DSTATE_m = L4_MABX_B.Switch_a; |
| 22711 | |
| 22712 | /* Update for UnitDelay: '<S76>/Unit_Delay' */ |
| 22713 | L4_MABX_DW.Unit_Delay_DSTATE_fv = L4_MABX_B.AutonomousEnabled_d; |
| 22714 | |
| 22715 | /* Update for UnitDelay: '<S98>/Delay Input1' */ |
| 22716 | L4_MABX_DW.DelayInput1_DSTATE_d = L4_MABX_B.Compare_jp; |
| 22717 | |
| 22718 | /* Update for UnitDelay: '<S97>/Unit Delay' */ |
| 22719 | L4_MABX_DW.UnitDelay_DSTATE_b1 = L4_MABX_B.AND_f; |
| 22720 | |
| 22721 | /* Update for Enabled SubSystem: '<S79>/Throttle_controller_gov' incorporates: |
| 22722 | * EnablePort: '<S212>/Enable' |
| 22723 | */ |
| 22724 | if (L4_MABX_DW.Throttle_controller_gov_MODE) { |
| 22725 | /* Update for UnitDelay: '<S220>/Unit_Delay1' incorporates: |
| 22726 | * Constant: '<S220>/Constant3' |
| 22727 | */ |
| 22728 | L4_MABX_DW.Unit_Delay1_DSTATE_p1 = L4_MABX_P.Constant3_Value_lp; |
| 22729 | |
| 22730 | /* Update for UnitDelay: '<S220>/Unit_Delay' */ |
| 22731 | L4_MABX_DW.Unit_Delay_DSTATE_lq = L4_MABX_B.RelationalOperator_fl; |
| 22732 | |
| 22733 | /* Update for UnitDelay: '<S247>/Unit_Delay' incorporates: |
| 22734 | * Constant: '<S247>/Constant' |
| 22735 | */ |
| 22736 | L4_MABX_DW.Unit_Delay_DSTATE_be = L4_MABX_P.Constant_Value_ck; |
| 22737 | |
| 22738 | /* Update for UnitDelay: '<S267>/Unit_Delay1' incorporates: |
| 22739 | * Constant: '<S267>/Constant' |
| 22740 | */ |
| 22741 | L4_MABX_DW.Unit_Delay1_DSTATE_h = L4_MABX_P.Constant_Value_ot; |
| 22742 | |
| 22743 | /* Update for UnitDelay: '<S268>/Unit_Delay' incorporates: |
| 22744 | * Constant: '<S268>/Constant' |
| 22745 | */ |
| 22746 | L4_MABX_DW.Unit_Delay_DSTATE_fi = L4_MABX_P.Constant_Value_h0; |
| 22747 | |
| 22748 | /* Update for UnitDelay: '<S272>/FixPt Unit Delay2' incorporates: |
| 22749 | * Constant: '<S272>/FixPt Constant' |
| 22750 | */ |
| 22751 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_gq = L4_MABX_P.FixPtConstant_Value_jk; |
| 22752 | |
| 22753 | /* Update for UnitDelay: '<S272>/FixPt Unit Delay1' */ |
| 22754 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_a = L4_MABX_B.If_Then_Else_cp.Switch; |
| 22755 | |
| 22756 | /* Update for UnitDelay: '<S267>/Unit_Delay2' */ |
| 22757 | L4_MABX_DW.Unit_Delay2_DSTATE_m = L4_MABX_B.If_Then_Else_k2.Switch; |
| 22758 | |
| 22759 | /* Update for Enabled SubSystem: '<S244>/Calculate_D_term' */ |
| 22760 | L4__Calculate_D_term_Update(&L4_MABX_B.Calculate_D_term_h, |
| 22761 | &L4_MABX_DW.Calculate_D_term_h, &L4_MABX_P.Calculate_D_term_h); |
| 22762 | |
| 22763 | /* End of Update for SubSystem: '<S244>/Calculate_D_term' */ |
| 22764 | |
| 22765 | /* Update for UnitDelay: '<S222>/Unit_Delay' */ |
| 22766 | L4_MABX_DW.Unit_Delay_DSTATE_fz = L4_MABX_B.Add_ds; |
| 22767 | |
| 22768 | /* Update for Enabled SubSystem: '<S244>/Calculate_I_term' */ |
| 22769 | L4__Calculate_I_term_Update(&L4_MABX_B.Calculate_I_term_n, |
| 22770 | &L4_MABX_DW.Calculate_I_term_n, &L4_MABX_P.Calculate_I_term_n); |
| 22771 | |
| 22772 | /* End of Update for SubSystem: '<S244>/Calculate_I_term' */ |
| 22773 | } |
| 22774 | |
| 22775 | /* End of Update for SubSystem: '<S79>/Throttle_controller_gov' */ |
| 22776 | |
| 22777 | /* Update for Enabled SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' incorporates: |
| 22778 | * EnablePort: '<S184>/Enable' |
| 22779 | */ |
| 22780 | if (L4_MABX_DW.Determine_shift_interlock_brake) { |
| 22781 | /* Update for UnitDelay: '<S184>/Unit_Delay' */ |
| 22782 | L4_MABX_DW.Unit_Delay_DSTATE_o = L4_MABX_B.If_Then_Else_il.Switch; |
| 22783 | |
| 22784 | /* Update for UnitDelay: '<S194>/Unit_Delay' incorporates: |
| 22785 | * Constant: '<S194>/Constant' |
| 22786 | */ |
| 22787 | L4_MABX_DW.Unit_Delay_DSTATE_ae = L4_MABX_P.Constant_Value_ii; |
| 22788 | |
| 22789 | /* Update for UnitDelay: '<S198>/FixPt Unit Delay2' incorporates: |
| 22790 | * Constant: '<S198>/FixPt Constant' |
| 22791 | */ |
| 22792 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_l = L4_MABX_P.FixPtConstant_Value_kr; |
| 22793 | |
| 22794 | /* Update for UnitDelay: '<S198>/FixPt Unit Delay1' */ |
| 22795 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_ds = L4_MABX_B.If_Then_Else_ep.Switch; |
| 22796 | |
| 22797 | /* Update for UnitDelay: '<S195>/Unit_Delay' */ |
| 22798 | L4_MABX_DW.Unit_Delay_DSTATE_om = L4_MABX_B.DigitalClock_e; |
| 22799 | } |
| 22800 | |
| 22801 | /* End of Update for SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */ |
| 22802 | |
| 22803 | /* Update for Enabled SubSystem: '<S105>/Determine_brake_hold_pressure_target' incorporates: |
| 22804 | * EnablePort: '<S183>/Enable' |
| 22805 | */ |
| 22806 | if (L4_MABX_DW.Determine_brake_hold_pressure_t) { |
| 22807 | /* Update for UnitDelay: '<S183>/Unit_Delay' */ |
| 22808 | L4_MABX_DW.Unit_Delay_DSTATE_c = L4_MABX_B.If_Then_Else_gj.Switch; |
| 22809 | |
| 22810 | /* Update for UnitDelay: '<S187>/Unit_Delay' incorporates: |
| 22811 | * Constant: '<S187>/Constant' |
| 22812 | */ |
| 22813 | L4_MABX_DW.Unit_Delay_DSTATE_or = L4_MABX_P.Constant_Value_m3; |
| 22814 | |
| 22815 | /* Update for UnitDelay: '<S191>/FixPt Unit Delay2' incorporates: |
| 22816 | * Constant: '<S191>/FixPt Constant' |
| 22817 | */ |
| 22818 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_je = L4_MABX_P.FixPtConstant_Value_aw; |
| 22819 | |
| 22820 | /* Update for UnitDelay: '<S191>/FixPt Unit Delay1' */ |
| 22821 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_b = L4_MABX_B.If_Then_Else_nz.Switch; |
| 22822 | |
| 22823 | /* Update for UnitDelay: '<S188>/Unit_Delay' */ |
| 22824 | L4_MABX_DW.Unit_Delay_DSTATE_oj = L4_MABX_B.DigitalClock_c; |
| 22825 | } |
| 22826 | |
| 22827 | /* End of Update for SubSystem: '<S105>/Determine_brake_hold_pressure_target' */ |
| 22828 | |
| 22829 | /* Update for Enabled SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' incorporates: |
| 22830 | * EnablePort: '<S102>/Enable' |
| 22831 | */ |
| 22832 | if (L4_MABX_DW.Bendix_2C2_brake_application_pr) { |
| 22833 | /* Update for UnitDelay: '<S111>/Unit_Delay' */ |
| 22834 | L4_MABX_DW.Unit_Delay_DSTATE_dc = L4_MABX_B.DigitalClock_j; |
| 22835 | |
| 22836 | /* Update for UnitDelay: '<S115>/Unit_Delay' incorporates: |
| 22837 | * Constant: '<S115>/Constant' |
| 22838 | */ |
| 22839 | L4_MABX_DW.Unit_Delay_DSTATE_omj = L4_MABX_P.Constant_Value_lo; |
| 22840 | |
| 22841 | /* Update for UnitDelay: '<S135>/Unit_Delay1' incorporates: |
| 22842 | * Constant: '<S135>/Constant' |
| 22843 | */ |
| 22844 | L4_MABX_DW.Unit_Delay1_DSTATE_b = L4_MABX_P.Constant_Value_olo; |
| 22845 | |
| 22846 | /* Update for UnitDelay: '<S136>/Unit_Delay' incorporates: |
| 22847 | * Constant: '<S136>/Constant' |
| 22848 | */ |
| 22849 | L4_MABX_DW.Unit_Delay_DSTATE_h4 = L4_MABX_P.Constant_Value_hi; |
| 22850 | |
| 22851 | /* Update for UnitDelay: '<S140>/FixPt Unit Delay2' incorporates: |
| 22852 | * Constant: '<S140>/FixPt Constant' |
| 22853 | */ |
| 22854 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_gm = L4_MABX_P.FixPtConstant_Value_f; |
| 22855 | |
| 22856 | /* Update for UnitDelay: '<S140>/FixPt Unit Delay1' */ |
| 22857 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g1 = L4_MABX_B.If_Then_Else_bg.Switch; |
| 22858 | |
| 22859 | /* Update for UnitDelay: '<S135>/Unit_Delay2' */ |
| 22860 | L4_MABX_DW.Unit_Delay2_DSTATE_dy = L4_MABX_B.If_Then_Else_ly.Switch; |
| 22861 | |
| 22862 | /* Update for Enabled SubSystem: '<S112>/Calculate_D_term' */ |
| 22863 | L4__Calculate_D_term_Update(&L4_MABX_B.Calculate_D_term, |
| 22864 | &L4_MABX_DW.Calculate_D_term, &L4_MABX_P.Calculate_D_term); |
| 22865 | |
| 22866 | /* End of Update for SubSystem: '<S112>/Calculate_D_term' */ |
| 22867 | |
| 22868 | /* Update for UnitDelay: '<S110>/Unit_Delay' */ |
| 22869 | L4_MABX_DW.Unit_Delay_DSTATE_i2 = L4_MABX_B.Add_e; |
| 22870 | |
| 22871 | /* Update for Enabled SubSystem: '<S112>/Calculate_I_term' */ |
| 22872 | L4__Calculate_I_term_Update(&L4_MABX_B.Calculate_I_term, |
| 22873 | &L4_MABX_DW.Calculate_I_term, &L4_MABX_P.Calculate_I_term); |
| 22874 | |
| 22875 | /* End of Update for SubSystem: '<S112>/Calculate_I_term' */ |
| 22876 | } |
| 22877 | |
| 22878 | /* End of Update for SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */ |
| 22879 | |
| 22880 | /* Update for UnitDelay: '<S395>/Unit_Delay' */ |
| 22881 | L4_MABX_DW.Unit_Delay_DSTATE_cx = L4_MABX_B.LogicalOperator2_f; |
| 22882 | |
| 22883 | /* Update for UnitDelay: '<S396>/Unit_Delay' incorporates: |
| 22884 | * Constant: '<S396>/Constant' |
| 22885 | */ |
| 22886 | L4_MABX_DW.Unit_Delay_DSTATE_d0 = L4_MABX_P.Constant_Value_c1; |
| 22887 | |
| 22888 | /* Update for UnitDelay: '<S353>/Unit_Delay' */ |
| 22889 | L4_MABX_DW.Unit_Delay_DSTATE_e = L4_MABX_B.If_Then_Else_m4.Switch; |
| 22890 | |
| 22891 | /* Update for UnitDelay: '<S400>/FixPt Unit Delay2' incorporates: |
| 22892 | * Constant: '<S400>/FixPt Constant' |
| 22893 | */ |
| 22894 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_aq = L4_MABX_P.FixPtConstant_Value_jx; |
| 22895 | |
| 22896 | /* Update for UnitDelay: '<S400>/FixPt Unit Delay1' */ |
| 22897 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_h = L4_MABX_B.If_Then_Else_m4.Switch; |
| 22898 | |
| 22899 | /* Update for UnitDelay: '<S397>/Unit_Delay' */ |
| 22900 | L4_MABX_DW.Unit_Delay_DSTATE_m = L4_MABX_B.DigitalClock; |
| 22901 | |
| 22902 | /* Update for UnitDelay: '<S384>/Unit_Delay' */ |
| 22903 | L4_MABX_DW.Unit_Delay_DSTATE_iy = L4_MABX_B.LogicalOperator1_gm; |
| 22904 | |
| 22905 | /* Update for UnitDelay: '<S385>/Unit_Delay' incorporates: |
| 22906 | * Constant: '<S385>/Constant' |
| 22907 | */ |
| 22908 | L4_MABX_DW.Unit_Delay_DSTATE_mv = L4_MABX_P.Constant_Value_am; |
| 22909 | |
| 22910 | /* Update for UnitDelay: '<S351>/Unit_Delay' */ |
| 22911 | L4_MABX_DW.Unit_Delay_DSTATE_g = L4_MABX_B.If_Then_Else_bf.Switch; |
| 22912 | |
| 22913 | /* Update for UnitDelay: '<S389>/FixPt Unit Delay2' incorporates: |
| 22914 | * Constant: '<S389>/FixPt Constant' |
| 22915 | */ |
| 22916 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_ip = L4_MABX_P.FixPtConstant_Value_d; |
| 22917 | |
| 22918 | /* Update for UnitDelay: '<S389>/FixPt Unit Delay1' */ |
| 22919 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_hq = L4_MABX_B.If_Then_Else_bf.Switch; |
| 22920 | |
| 22921 | /* Update for UnitDelay: '<S386>/Unit_Delay' */ |
| 22922 | L4_MABX_DW.Unit_Delay_DSTATE_b = L4_MABX_B.DigitalClock_b; |
| 22923 | |
| 22924 | /* Update for UnitDelay: '<S348>/Delay Input1' */ |
| 22925 | L4_MABX_DW.DelayInput1_DSTATE[0] = L4_MABX_B.Distance_to_achieve_speed_targe; |
| 22926 | L4_MABX_DW.DelayInput1_DSTATE[1] = L4_MABX_B.Vehicle_speed_target_o; |
| 22927 | |
| 22928 | /* Update for UnitDelay: '<S366>/Unit_Delay' */ |
| 22929 | L4_MABX_DW.Unit_Delay_DSTATE_bw = L4_MABX_B.If_Then_Else_og.Switch; |
| 22930 | |
| 22931 | /* Update for UnitDelay: '<S368>/Unit_Delay' */ |
| 22932 | L4_MABX_DW.Unit_Delay_DSTATE_ko = L4_MABX_B.LogicalOperator1_ph; |
| 22933 | |
| 22934 | /* Update for UnitDelay: '<S377>/FixPt Unit Delay2' incorporates: |
| 22935 | * Constant: '<S377>/FixPt Constant' |
| 22936 | */ |
| 22937 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_f = L4_MABX_P.FixPtConstant_Value_g; |
| 22938 | |
| 22939 | /* Update for UnitDelay: '<S377>/FixPt Unit Delay1' */ |
| 22940 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_l = L4_MABX_B.Xnew; |
| 22941 | |
| 22942 | /* Update for UnitDelay: '<S375>/Unit_Delay' */ |
| 22943 | L4_MABX_DW.Unit_Delay_DSTATE_p = L4_MABX_B.DigitalClock_f; |
| 22944 | |
| 22945 | /* Update for UnitDelay: '<S355>/Delay Input1' */ |
| 22946 | L4_MABX_DW.DelayInput1_DSTATE_f[0] = L4_MABX_B.Distance_to_achieve_speed_targe; |
| 22947 | L4_MABX_DW.DelayInput1_DSTATE_f[1] = L4_MABX_B.Vehicle_speed_target_o; |
| 22948 | |
| 22949 | /* Update for UnitDelay: '<S357>/Unit_Delay' incorporates: |
| 22950 | * Constant: '<S357>/Constant' |
| 22951 | */ |
| 22952 | L4_MABX_DW.Unit_Delay_DSTATE_l = L4_MABX_P.Constant_Value_pu; |
| 22953 | |
| 22954 | /* Update for UnitDelay: '<S361>/FixPt Unit Delay2' incorporates: |
| 22955 | * Constant: '<S361>/FixPt Constant' |
| 22956 | */ |
| 22957 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_c = L4_MABX_P.FixPtConstant_Value_az; |
| 22958 | |
| 22959 | /* Update for UnitDelay: '<S361>/FixPt Unit Delay1' */ |
| 22960 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_ej = L4_MABX_B.If_Then_Else_pz.Switch; |
| 22961 | |
| 22962 | /* Update for UnitDelay: '<S356>/Unit_Delay' */ |
| 22963 | L4_MABX_DW.Unit_Delay_1_DSTATE_j = |
| 22964 | L4_MABX_B.If_Then_Else_mm.Vehicle_speed_target; |
| 22965 | L4_MABX_DW.Unit_Delay_2_DSTATE_e = L4_MABX_B.If_Then_Else_mm.Vehicle_speed; |
| 22966 | L4_MABX_DW.Unit_Delay_3_DSTATE_j = L4_MABX_B.If_Then_Else_mm.Distance_m; |
| 22967 | |
| 22968 | /* Update for UnitDelay: '<S354>/Unit_Delay' */ |
| 22969 | L4_MABX_DW.Unit_Delay_DSTATE_f = L4_MABX_B.DigitalClock_p; |
| 22970 | |
| 22971 | /* Update for Enabled SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' incorporates: |
| 22972 | * EnablePort: '<S103>/Enable' |
| 22973 | */ |
| 22974 | if (L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba) { |
| 22975 | /* Update for UnitDelay: '<S146>/Unit_Delay' */ |
| 22976 | L4_MABX_DW.Unit_Delay_DSTATE_eu = L4_MABX_B.DigitalClock_n; |
| 22977 | |
| 22978 | /* Update for UnitDelay: '<S153>/Unit_Delay' incorporates: |
| 22979 | * Constant: '<S153>/Constant' |
| 22980 | */ |
| 22981 | L4_MABX_DW.Unit_Delay_DSTATE_n = L4_MABX_P.Constant_Value_j5; |
| 22982 | |
| 22983 | /* Update for UnitDelay: '<S173>/Unit_Delay1' incorporates: |
| 22984 | * Constant: '<S173>/Constant' |
| 22985 | */ |
| 22986 | L4_MABX_DW.Unit_Delay1_DSTATE_f = L4_MABX_P.Constant_Value_bd; |
| 22987 | |
| 22988 | /* Update for UnitDelay: '<S174>/Unit_Delay' incorporates: |
| 22989 | * Constant: '<S174>/Constant' |
| 22990 | */ |
| 22991 | L4_MABX_DW.Unit_Delay_DSTATE_g4 = L4_MABX_P.Constant_Value_m2; |
| 22992 | |
| 22993 | /* Update for UnitDelay: '<S178>/FixPt Unit Delay2' incorporates: |
| 22994 | * Constant: '<S178>/FixPt Constant' |
| 22995 | */ |
| 22996 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_o = L4_MABX_P.FixPtConstant_Value_j1; |
| 22997 | |
| 22998 | /* Update for UnitDelay: '<S178>/FixPt Unit Delay1' */ |
| 22999 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g2 = L4_MABX_B.If_Then_Else_iy.Switch; |
| 23000 | |
| 23001 | /* Update for UnitDelay: '<S173>/Unit_Delay2' */ |
| 23002 | L4_MABX_DW.Unit_Delay2_DSTATE_c = L4_MABX_B.If_Then_Else_bc.Switch; |
| 23003 | |
| 23004 | /* Update for Enabled SubSystem: '<S150>/Calculate_D_term' */ |
| 23005 | L4__Calculate_D_term_Update(&L4_MABX_B.Calculate_D_term_p, |
| 23006 | &L4_MABX_DW.Calculate_D_term_p, &L4_MABX_P.Calculate_D_term_p); |
| 23007 | |
| 23008 | /* End of Update for SubSystem: '<S150>/Calculate_D_term' */ |
| 23009 | |
| 23010 | /* Update for UnitDelay: '<S145>/Unit_Delay' */ |
| 23011 | L4_MABX_DW.Unit_Delay_DSTATE_h = L4_MABX_B.Add_mh; |
| 23012 | |
| 23013 | /* Update for Enabled SubSystem: '<S150>/Calculate_I_term' */ |
| 23014 | L4__Calculate_I_term_Update(&L4_MABX_B.Calculate_I_term_e, |
| 23015 | &L4_MABX_DW.Calculate_I_term_e, &L4_MABX_P.Calculate_I_term_e); |
| 23016 | |
| 23017 | /* End of Update for SubSystem: '<S150>/Calculate_I_term' */ |
| 23018 | } |
| 23019 | |
| 23020 | /* End of Update for SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */ |
| 23021 | |
| 23022 | /* Update for UnitDelay: '<S107>/Unit_Delay' incorporates: |
| 23023 | * Constant: '<S107>/Constant7' |
| 23024 | */ |
| 23025 | L4_MABX_DW.Unit_Delay_DSTATE_eu4 = L4_MABX_P.Constant7_Value_j; |
| 23026 | |
| 23027 | /* Update for UnitDelay: '<S203>/Unit_Delay1' incorporates: |
| 23028 | * Constant: '<S203>/Constant' |
| 23029 | */ |
| 23030 | L4_MABX_DW.Unit_Delay1_DSTATE_di = L4_MABX_P.Constant_Value_jf; |
| 23031 | |
| 23032 | /* Update for UnitDelay: '<S203>/Unit_Delay2' */ |
| 23033 | L4_MABX_DW.Unit_Delay2_DSTATE_e = L4_MABX_B.If_Then_Else_g.Switch; |
| 23034 | |
| 23035 | /* Update for UnitDelay: '<S202>/UD' */ |
| 23036 | L4_MABX_DW.UD_DSTATE = L4_MABX_B.TSamp; |
| 23037 | |
| 23038 | /* Update for UnitDelay: '<S333>/Unit_Delay1' incorporates: |
| 23039 | * Constant: '<S333>/Constant' |
| 23040 | */ |
| 23041 | L4_MABX_DW.Unit_Delay1_DSTATE_db = L4_MABX_P.Constant_Value_hx; |
| 23042 | |
| 23043 | /* Update for UnitDelay: '<S333>/Unit_Delay2' */ |
| 23044 | L4_MABX_DW.Unit_Delay2_DSTATE_d = L4_MABX_B.If_Then_Else_b3.Switch; |
| 23045 | |
| 23046 | /* Update for UnitDelay: '<S332>/Delay Input1' */ |
| 23047 | L4_MABX_DW.DelayInput1_DSTATE_f0 = L4_MABX_B.JumpNearEdge; |
| 23048 | |
| 23049 | /* Update for UnitDelay: '<S334>/Unit_Delay1' incorporates: |
| 23050 | * Constant: '<S334>/Constant' |
| 23051 | */ |
| 23052 | L4_MABX_DW.Unit_Delay1_DSTATE_a = L4_MABX_P.Constant_Value_bh; |
| 23053 | |
| 23054 | /* Update for UnitDelay: '<S334>/Unit_Delay2' */ |
| 23055 | L4_MABX_DW.Unit_Delay2_DSTATE_i = L4_MABX_B.If_Then_Else_mk.Switch; |
| 23056 | |
| 23057 | /* Update for UnitDelay: '<S335>/Unit_Delay1' incorporates: |
| 23058 | * Constant: '<S335>/Constant' |
| 23059 | */ |
| 23060 | L4_MABX_DW.Unit_Delay1_DSTATE_p3 = L4_MABX_P.Constant_Value_hxo; |
| 23061 | |
| 23062 | /* Update for UnitDelay: '<S335>/Unit_Delay2' */ |
| 23063 | L4_MABX_DW.Unit_Delay2_DSTATE_p = L4_MABX_B.If_Then_Else_lh.Switch; |
| 23064 | |
| 23065 | /* Update for Enabled SubSystem: '<S283>/Slew_at_event' incorporates: |
| 23066 | * EnablePort: '<S340>/Enable' |
| 23067 | */ |
| 23068 | if (L4_MABX_DW.Slew_at_event_MODE_d) { |
| 23069 | /* Update for UnitDelay: '<S342>/Unit_Delay' */ |
| 23070 | L4_MABX_DW.Unit_Delay_DSTATE_bd = L4_MABX_B.DataTypeConversion_l1; |
| 23071 | |
| 23072 | /* Update for UnitDelay: '<S343>/Unit_Delay' incorporates: |
| 23073 | * Constant: '<S343>/Constant' |
| 23074 | */ |
| 23075 | L4_MABX_DW.Unit_Delay_DSTATE_jt = L4_MABX_P.Constant_Value_hgm; |
| 23076 | |
| 23077 | /* Update for UnitDelay: '<S346>/FixPt Unit Delay2' incorporates: |
| 23078 | * Constant: '<S346>/FixPt Constant' |
| 23079 | */ |
| 23080 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_j = L4_MABX_P.FixPtConstant_Value_np; |
| 23081 | |
| 23082 | /* Update for UnitDelay: '<S346>/FixPt Unit Delay1' */ |
| 23083 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_ov = L4_MABX_B.If_Then_Else_n3.Switch; |
| 23084 | |
| 23085 | /* Update for UnitDelay: '<S341>/Unit_Delay' */ |
| 23086 | L4_MABX_DW.Unit_Delay_DSTATE_ll = L4_MABX_B.LogicalOperator_dm; |
| 23087 | } |
| 23088 | |
| 23089 | /* End of Update for SubSystem: '<S283>/Slew_at_event' */ |
| 23090 | |
| 23091 | /* Update for UnitDelay: '<S285>/Unit Delay' */ |
| 23092 | L4_MABX_DW.UnitDelay_DSTATE_d = L4_MABX_B.Switch1_fi; |
| 23093 | |
| 23094 | /* Update for UnitDelay: '<S295>/Unit Delay' */ |
| 23095 | L4_MABX_DW.UnitDelay_DSTATE_m = L4_MABX_B.Add1_m; |
| 23096 | |
| 23097 | /* Update for UnitDelay: '<S296>/Unit Delay' */ |
| 23098 | L4_MABX_DW.UnitDelay_DSTATE_m0 = L4_MABX_B.Switch_k; |
| 23099 | |
| 23100 | /* Update for UnitDelay: '<S296>/Unit Delay1' */ |
| 23101 | L4_MABX_DW.UnitDelay1_DSTATE_k = L4_MABX_B.Divide1_b; |
| 23102 | |
| 23103 | /* Update for UnitDelay: '<S290>/Unit Delay' */ |
| 23104 | L4_MABX_DW.UnitDelay_DSTATE_m1 = L4_MABX_B.Switch1_pb; |
| 23105 | |
| 23106 | /* Update for UnitDelay: '<S314>/Delay Input2' */ |
| 23107 | L4_MABX_DW.DelayInput2_DSTATE = L4_MABX_B.DifferenceInputs2; |
| 23108 | |
| 23109 | /* Update for DiscreteIntegrator: '<S313>/Integrator' */ |
| 23110 | L4_MABX_DW.Integrator_DSTATE += L4_MABX_P.Integrator_gainval * |
| 23111 | L4_MABX_B.IntegralGain; |
| 23112 | L4_MABX_DW.Integrator_PrevResetState = (int8_T)L4_MABX_B.AutonomousEnabled_d; |
| 23113 | |
| 23114 | /* Update for DiscreteIntegrator: '<S313>/Filter' */ |
| 23115 | L4_MABX_DW.Filter_DSTATE += L4_MABX_P.Filter_gainval * |
| 23116 | L4_MABX_B.FilterCoefficient; |
| 23117 | L4_MABX_DW.Filter_PrevResetState = (int8_T)L4_MABX_B.AutonomousEnabled_d; |
| 23118 | |
| 23119 | /* Update for UnitDelay: '<S317>/Delay Input' */ |
| 23120 | L4_MABX_DW.DelayInput_DSTATE = L4_MABX_B.Saturate; |
| 23121 | |
| 23122 | /* Update for UnitDelay: '<S317>/Delay Output' */ |
| 23123 | L4_MABX_DW.DelayOutput_DSTATE = L4_MABX_B.Downcast; |
| 23124 | |
| 23125 | /* Update for UnitDelay: '<S315>/Delay Input2' */ |
| 23126 | L4_MABX_DW.DelayInput2_DSTATE_a = L4_MABX_B.DifferenceInputs2_a; |
| 23127 | |
| 23128 | /* Update for DiscreteIntegrator: '<S307>/Discrete-Time Integrator' */ |
| 23129 | L4_MABX_DW.DiscreteTimeIntegrator_IC_LOADI = 0U; |
| 23130 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE += |
| 23131 | L4_MABX_P.DiscreteTimeIntegrator_gainval * L4_MABX_B.Gain_o; |
| 23132 | L4_MABX_DW.DiscreteTimeIntegrator_PrevRese = (int8_T) |
| 23133 | L4_MABX_B.AutonomousEnabled_d; |
| 23134 | |
| 23135 | /* Update for UnitDelay: '<S327>/Delay Input2' */ |
| 23136 | L4_MABX_DW.DelayInput2_DSTATE_l = L4_MABX_B.DifferenceInputs2_m; |
| 23137 | |
| 23138 | /* Update for UnitDelay: '<S304>/Delay Input2' */ |
| 23139 | L4_MABX_DW.DelayInput2_DSTATE_o = L4_MABX_B.DifferenceInputs2_f; |
| 23140 | |
| 23141 | /* Update for DiscreteIntegrator: '<S80>/Discrete-Time Integrator' incorporates: |
| 23142 | * Constant: '<S80>/ResetIntegrator' |
| 23143 | */ |
| 23144 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e += |
| 23145 | L4_MABX_P.DiscreteTimeIntegrator_gainva_l * L4_MABX_B.Switch1_p; |
| 23146 | if (L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e >= |
| 23147 | L4_MABX_P.DiscreteTimeIntegrator_UpperSat) { |
| 23148 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e = |
| 23149 | L4_MABX_P.DiscreteTimeIntegrator_UpperSat; |
| 23150 | } else { |
| 23151 | if (L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e <= |
| 23152 | L4_MABX_P.DiscreteTimeIntegrator_LowerSat) { |
| 23153 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e = |
| 23154 | L4_MABX_P.DiscreteTimeIntegrator_LowerSat; |
| 23155 | } |
| 23156 | } |
| 23157 | |
| 23158 | if (L4_MABX_P.ResetIntegrator_Value > 0.0) { |
| 23159 | L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e = 1; |
| 23160 | } else if (L4_MABX_P.ResetIntegrator_Value < 0.0) { |
| 23161 | L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e = -1; |
| 23162 | } else if (L4_MABX_P.ResetIntegrator_Value == 0.0) { |
| 23163 | L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e = 0; |
| 23164 | } else { |
| 23165 | L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e = 2; |
| 23166 | } |
| 23167 | |
| 23168 | /* End of Update for DiscreteIntegrator: '<S80>/Discrete-Time Integrator' */ |
| 23169 | |
| 23170 | /* Update for UnitDelay: '<S80>/Unit Delay' */ |
| 23171 | L4_MABX_DW.UnitDelay_DSTATE_e = L4_MABX_B.Switch2_i1; |
| 23172 | |
| 23173 | /* Update for UnitDelay: '<S379>/FixPt Unit Delay2' incorporates: |
| 23174 | * Constant: '<S379>/FixPt Constant' |
| 23175 | */ |
| 23176 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_aw = L4_MABX_P.FixPtConstant_Value_p; |
| 23177 | |
| 23178 | /* Update for UnitDelay: '<S379>/FixPt Unit Delay1' */ |
| 23179 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_p = L4_MABX_B.Xnew_h; |
| 23180 | |
| 23181 | /* Update for UnitDelay: '<S380>/FixPt Unit Delay2' incorporates: |
| 23182 | * Constant: '<S380>/FixPt Constant' |
| 23183 | */ |
| 23184 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_gx = L4_MABX_P.FixPtConstant_Value_e; |
| 23185 | |
| 23186 | /* Update for UnitDelay: '<S380>/FixPt Unit Delay1' */ |
| 23187 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g0 = L4_MABX_B.Xnew_f; |
| 23188 | |
| 23189 | /* Update for UnitDelay: '<S374>/Unit_Delay' */ |
| 23190 | L4_MABX_DW.Unit_Delay_DSTATE_j = L4_MABX_B.DigitalClock_d; |
| 23191 | |
| 23192 | /* End of Update for SubSystem: '<S65>/Task_10ms' */ |
| 23193 | |
| 23194 | /* Update for Atomic SubSystem: '<S855>/CAN_TX_10ms' */ |
| 23195 | |
| 23196 | /* Update for UnitDelay: '<S1012>/Unit_Delay' */ |
| 23197 | L4_MABX_DW.Unit_Delay_DSTATE_mr = L4_MABX_B.Operator_k1o; |
| 23198 | |
| 23199 | /* Update for UnitDelay: '<S1013>/Unit Delay' */ |
| 23200 | L4_MABX_DW.UnitDelay_DSTATE_c = L4_MABX_B.Switch1_a; |
| 23201 | |
| 23202 | /* End of Update for SubSystem: '<S855>/CAN_TX_10ms' */ |
| 23203 | |
| 23204 | /* Update for UnitDelay: '<S865>/Unit Delay2' */ |
| 23205 | L4_MABX_DW.UnitDelay2_DSTATE = L4_MABX_B.enTPCM; |
| 23206 | |
| 23207 | /* Update for UnitDelay: '<S865>/Unit Delay1' */ |
| 23208 | L4_MABX_DW.UnitDelay1_DSTATE_mt = L4_MABX_B.TPDT_count; |
| 23209 | |
| 23210 | /* Update for UnitDelay: '<S865>/Unit Delay3' */ |
| 23211 | L4_MABX_DW.UnitDelay3_DSTATE = L4_MABX_B.enTPDT; |
| 23212 | |
| 23213 | /* Update for UnitDelay: '<S3>/Unit_Delay' incorporates: |
| 23214 | * Constant: '<S208>/Constant' |
| 23215 | * Constant: '<S80>/zero' |
| 23216 | */ |
| 23217 | L4_MABX_DW.Unit_Delay_1_DSTATE = L4_MABX_B.Subtract_c1; |
| 23218 | L4_MABX_DW.Unit_Delay_10_DSTATE = L4_MABX_B.Add1_hl; |
| 23219 | L4_MABX_DW.Unit_Delay_100_DSTATE = L4_MABX_B.SFunction1_o3_ho; |
| 23220 | L4_MABX_DW.Unit_Delay_101_DSTATE = L4_MABX_B.SPN514_NominalFrictionPercentTo; |
| 23221 | L4_MABX_DW.Unit_Delay_102_DSTATE = L4_MABX_B.SPN2978_EstEngParasiticLossesPe; |
| 23222 | L4_MABX_DW.Unit_Delay_103_DSTATE = L4_MABX_B.SPN1760_GrossCombinationVehicle; |
| 23223 | L4_MABX_DW.Unit_Delay_104_DSTATE = L4_MABX_B.ACCDistanceAlertSignal; |
| 23224 | L4_MABX_DW.Unit_Delay_105_DSTATE = L4_MABX_B.ForwardCollisionWarning; |
| 23225 | L4_MABX_DW.Unit_Delay_106_DSTATE = L4_MABX_B.SPN544_EngineReferenceTorque; |
| 23226 | L4_MABX_DW.Unit_Delay_107_DSTATE = L4_MABX_B.SFunction1_o4_lj; |
| 23227 | L4_MABX_DW.Unit_Delay_108_DSTATE = L4_MABX_B.SFunction1_o5_i; |
| 23228 | L4_MABX_DW.Unit_Delay_109_DSTATE = L4_MABX_B.SFunction1_o6_d; |
| 23229 | L4_MABX_DW.Unit_Delay_11_DSTATE = L4_MABX_B.Switch2_i1; |
| 23230 | L4_MABX_DW.Unit_Delay_110_DSTATE = L4_MABX_B.SFunction1_o7_h; |
| 23231 | L4_MABX_DW.Unit_Delay_111_DSTATE = SteerWheelAngle; |
| 23232 | L4_MABX_DW.Unit_Delay_112_DSTATE = YawRate; |
| 23233 | L4_MABX_DW.Unit_Delay_113_DSTATE = SPN1810_LongitudinalAcceleration; |
| 23234 | L4_MABX_DW.Unit_Delay_114_DSTATE = L4_MABX_B.SFunction1_o2_gn; |
| 23235 | L4_MABX_DW.Unit_Delay_115_DSTATE = L4_MABX_B.SFunction1_o3_jk; |
| 23236 | L4_MABX_DW.Unit_Delay_116_DSTATE = L4_MABX_B.SFunction1_o5_f; |
| 23237 | L4_MABX_DW.Unit_Delay_117_DSTATE = L4_MABX_B.SFunction1_o1_a5; |
| 23238 | L4_MABX_DW.Unit_Delay_118_DSTATE = L4_MABX_B.SFunction1_o3_fp; |
| 23239 | L4_MABX_DW.Unit_Delay_119_DSTATE = L4_MABX_B.LogicalOperator1_c; |
| 23240 | L4_MABX_DW.Unit_Delay_12_DSTATE = L4_MABX_B.DiscreteTimeIntegrator_h; |
| 23241 | L4_MABX_DW.Unit_Delay_120_DSTATE = L4_MABX_B.LogicalOperator1_cl; |
| 23242 | L4_MABX_DW.Unit_Delay_121_DSTATE = L4_MABX_B.PitchAngleExRange; |
| 23243 | L4_MABX_DW.Unit_Delay_122_DSTATE = L4_MABX_B.SFunction1_o3_ev; |
| 23244 | L4_MABX_DW.Unit_Delay_123_DSTATE = L4_MABX_B.SFunction1_o1_oq; |
| 23245 | L4_MABX_DW.Unit_Delay_124_DSTATE = L4_MABX_B.SFunction1_o2_mr; |
| 23246 | L4_MABX_DW.Unit_Delay_125_DSTATE = L4_MABX_B.Latitude_; |
| 23247 | L4_MABX_DW.Unit_Delay_126_DSTATE = L4_MABX_B.Longitude_; |
| 23248 | L4_MABX_DW.Unit_Delay_127_DSTATE = L4_MABX_B.HDOP_; |
| 23249 | L4_MABX_DW.Unit_Delay_128_DSTATE = L4_MABX_B.XPRControlMode; |
| 23250 | L4_MABX_DW.Unit_Delay_129_DSTATE = L4_MABX_B.XPRErrorState; |
| 23251 | L4_MABX_DW.Unit_Delay_13_DSTATE = L4_MABX_B.numLanePoints_j; |
| 23252 | L4_MABX_DW.Unit_Delay_130_DSTATE = L4_MABX_B.PressureP1; |
| 23253 | L4_MABX_DW.Unit_Delay_131_DSTATE = L4_MABX_B.PressureP4; |
| 23254 | L4_MABX_DW.Unit_Delay_132_DSTATE = L4_MABX_B.PressureP21; |
| 23255 | L4_MABX_DW.Unit_Delay_133_DSTATE = L4_MABX_B.PressureP22; |
| 23256 | L4_MABX_DW.Unit_Delay_134_DSTATE = L4_MABX_B.PressureP42; |
| 23257 | L4_MABX_DW.Unit_Delay_135_DSTATE = ReAX_ActualHandwheelPos; |
| 23258 | L4_MABX_DW.Unit_Delay_136_DSTATE = ReAX_EchoedSteerWheelPos; |
| 23259 | L4_MABX_DW.Unit_Delay_137_DSTATE = L4_MABX_B.SystemsOk; |
| 23260 | L4_MABX_DW.Unit_Delay_138_DSTATE = SupervisorMode; |
| 23261 | L4_MABX_DW.Unit_Delay_139_DSTATE = CurrentAzimuth_rad; |
| 23262 | L4_MABX_DW.Unit_Delay_14_DSTATE = L4_MABX_B.correctedError; |
| 23263 | L4_MABX_DW.Unit_Delay_140_DSTATE = TargetAzimuth_rad; |
| 23264 | L4_MABX_DW.Unit_Delay_141_DSTATE = CurrentVelocity_kph; |
| 23265 | L4_MABX_DW.Unit_Delay_142_DSTATE = TargetVelocity_kph; |
| 23266 | L4_MABX_DW.Unit_Delay_143_DSTATE = Curvature; |
| 23267 | L4_MABX_DW.Unit_Delay_144_DSTATE = CrosstrackError; |
| 23268 | L4_MABX_DW.Unit_Delay_15_DSTATE = L4_MABX_B.Switch1_j; |
| 23269 | L4_MABX_DW.Unit_Delay_16_DSTATE = L4_MABX_B.rad2deg1; |
| 23270 | L4_MABX_DW.Unit_Delay_17_DSTATE = L4_MABX_B.If_Then_Else_iz.Switch; |
| 23271 | L4_MABX_DW.Unit_Delay_18_DSTATE = L4_MABX_B.APTC_arb_pedal_low_idl_sw_o; |
| 23272 | L4_MABX_DW.Unit_Delay_19_DSTATE = L4_MABX_B.If_Then_Else_f.Switch; |
| 23273 | L4_MABX_DW.Unit_Delay_2_DSTATE = L4_MABX_B.Add3; |
| 23274 | L4_MABX_DW.Unit_Delay_20_DSTATE = L4_MABX_P.Constant_Value_jg4; |
| 23275 | L4_MABX_DW.Unit_Delay_21_DSTATE = L4_MABX_B.If_Then_Else_pi.Switch; |
| 23276 | L4_MABX_DW.Unit_Delay_22_DSTATE = L4_MABX_B.Add_ds; |
| 23277 | L4_MABX_DW.Unit_Delay_23_DSTATE = L4_MABX_B.If_Then_Else_k2.Switch; |
| 23278 | L4_MABX_DW.Unit_Delay_24_DSTATE = L4_MABX_B.Product_i; |
| 23279 | L4_MABX_DW.Unit_Delay_25_DSTATE = L4_MABX_B.PID_i_term_c; |
| 23280 | L4_MABX_DW.Unit_Delay_26_DSTATE = L4_MABX_B.PID_d_term_c; |
| 23281 | L4_MABX_DW.Unit_Delay_27_DSTATE = L4_MABX_B.PID_hold_i_term_f_b; |
| 23282 | L4_MABX_DW.Unit_Delay_28_DSTATE = L4_MABX_B.ThrottlePID_Y_m; |
| 23283 | L4_MABX_DW.Unit_Delay_29_DSTATE = L4_MABX_B.MinMax1_n; |
| 23284 | L4_MABX_DW.Unit_Delay_3_DSTATE = L4_MABX_B.Add_px; |
| 23285 | L4_MABX_DW.Unit_Delay_30_DSTATE = L4_MABX_B.F_Ignition_relay_command_i; |
| 23286 | L4_MABX_DW.Unit_Delay_31_DSTATE = L4_MABX_B.F_Inverter_relay_command_p; |
| 23287 | L4_MABX_DW.Unit_Delay_32_DSTATE = L4_MABX_B.F_MABX_relay_command_n; |
| 23288 | L4_MABX_DW.Unit_Delay_33_DSTATE = L4_MABX_B.F_Sensor_relay_command_k; |
| 23289 | L4_MABX_DW.Unit_Delay_34_DSTATE = L4_MABX_B.BrkPedArbBrakeSwitch_c; |
| 23290 | L4_MABX_DW.Unit_Delay_35_DSTATE = L4_MABX_B.Diff; |
| 23291 | L4_MABX_DW.Unit_Delay_36_DSTATE = L4_MABX_B.F_Brake_control_active; |
| 23292 | L4_MABX_DW.Unit_Delay_37_DSTATE = L4_MABX_B.F_Hold_brakes_at_zero_d; |
| 23293 | L4_MABX_DW.Unit_Delay_38_DSTATE = L4_MABX_B.BrakingPID_Y_k; |
| 23294 | L4_MABX_DW.Unit_Delay_39_DSTATE = 0.0; |
| 23295 | L4_MABX_DW.Unit_Delay_4_DSTATE = L4_MABX_B.Product_d; |
| 23296 | L4_MABX_DW.Unit_Delay_40_DSTATE = L4_MABX_B.VSPD_TARGET_KPH_APV_g; |
| 23297 | L4_MABX_DW.Unit_Delay_41_DSTATE = L4_MABX_B.Vehicle_speed_target_n; |
| 23298 | L4_MABX_DW.Unit_Delay_42_DSTATE = L4_MABX_B.VSPD_HYST_KPH_APV_f; |
| 23299 | L4_MABX_DW.Unit_Delay_43_DSTATE = L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b; |
| 23300 | L4_MABX_DW.Unit_Delay_44_DSTATE = L4_MABX_B.ACCEL_LIM_MS2_APV_b; |
| 23301 | L4_MABX_DW.Unit_Delay_46_DSTATE = AutonomousOutputEnabled; |
| 23302 | L4_MABX_DW.Unit_Delay_5_DSTATE = L4_MABX_B.Switch2_i; |
| 23303 | L4_MABX_DW.Unit_Delay_6_DSTATE = L4_MABX_B.Conversion; |
| 23304 | L4_MABX_DW.Unit_Delay_7_DSTATE = L4_MABX_B.Add2; |
| 23305 | L4_MABX_DW.Unit_Delay_8_DSTATE = L4_MABX_P.zero_Value; |
| 23306 | L4_MABX_DW.Unit_Delay_82_DSTATE = EngagePB; |
| 23307 | L4_MABX_DW.Unit_Delay_85_DSTATE = Pedal_pwm_position; |
| 23308 | L4_MABX_DW.Unit_Delay_86_DSTATE = L4_MABX_B.IgnitionKeySwitch_voltage; |
| 23309 | L4_MABX_DW.Unit_Delay_87_DSTATE = L4_MABX_B.SFunction1_o8_fp; |
| 23310 | L4_MABX_DW.Unit_Delay_88_DSTATE = L4_MABX_B.SFunction1_o2_bl; |
| 23311 | L4_MABX_DW.Unit_Delay_89_DSTATE = L4_MABX_B.SFunction1_o7_g; |
| 23312 | L4_MABX_DW.Unit_Delay_9_DSTATE = L4_MABX_B.Add1_hl; |
| 23313 | L4_MABX_DW.Unit_Delay_90_DSTATE = L4_MABX_B.SFunction1_o1_gd; |
| 23314 | L4_MABX_DW.Unit_Delay_91_DSTATE = L4_MABX_B.SFunction1_o1_au; |
| 23315 | L4_MABX_DW.Unit_Delay_92_DSTATE = L4_MABX_B.SFunction1_o2_hu; |
| 23316 | L4_MABX_DW.Unit_Delay_93_DSTATE = L4_MABX_B.SFunction1_o4_nj; |
| 23317 | L4_MABX_DW.Unit_Delay_94_DSTATE = L4_MABX_B.SPN524_TransSelectedGear; |
| 23318 | L4_MABX_DW.Unit_Delay_95_DSTATE = L4_MABX_B.SPN523_TransCurrentGear; |
| 23319 | L4_MABX_DW.Unit_Delay_96_DSTATE = L4_MABX_B.SPN526_TransActualGearRatio; |
| 23320 | L4_MABX_DW.Unit_Delay_97_DSTATE = L4_MABX_B.SFunction1_o4_ki; |
| 23321 | L4_MABX_DW.Unit_Delay_98_DSTATE = L4_MABX_B.SFunction1_o2_dgu; |
| 23322 | L4_MABX_DW.Unit_Delay_99_DSTATE = L4_MABX_B.SFunction1_o5_nl; |
| 23323 | |
| 23324 | /* Update for UnitDelay: '<S655>/Unit_Delay2' */ |
| 23325 | L4_MABX_DW.Unit_Delay2_DSTATE_p1 = L4_MABX_B.LogicalOperator2_j; |
| 23326 | |
| 23327 | /* Update for UnitDelay: '<S655>/Unit_Delay1' incorporates: |
| 23328 | * Constant: '<S655>/Constant1' |
| 23329 | */ |
| 23330 | L4_MABX_DW.Unit_Delay1_DSTATE_d = L4_MABX_P.Constant1_Value_h; |
| 23331 | |
| 23332 | /* Update for UnitDelay: '<S662>/Unit_Delay' */ |
| 23333 | L4_MABX_DW.Unit_Delay_DSTATE_iv = L4_MABX_B.LogicalOperator1_cl; |
| 23334 | |
| 23335 | /* Update for UnitDelay: '<S753>/Delay Input1' */ |
| 23336 | L4_MABX_DW.DelayInput1_DSTATE_l = L4_MABX_B.Compare_ai; |
| 23337 | |
| 23338 | /* Update for UnitDelay: '<S754>/Unit Delay' */ |
| 23339 | L4_MABX_DW.UnitDelay_DSTATE_j = L4_MABX_B.Switch_m; |
| 23340 | |
| 23341 | /* Update for UnitDelay: '<S748>/Unit Delay' */ |
| 23342 | L4_MABX_DW.UnitDelay_DSTATE_cq = L4_MABX_B.AND_j; |
| 23343 | |
| 23344 | /* Update for UnitDelay: '<S752>/Delay Input1' */ |
| 23345 | L4_MABX_DW.DelayInput1_DSTATE_c = L4_MABX_B.Compare_b; |
| 23346 | |
| 23347 | /* Update for UnitDelay: '<S754>/Unit Delay1' */ |
| 23348 | L4_MABX_DW.UnitDelay1_DSTATE_n = L4_MABX_B.AND_d; |
| 23349 | |
| 23350 | /* Update for UnitDelay: '<S755>/Unit Delay' */ |
| 23351 | L4_MABX_DW.UnitDelay_DSTATE_is = L4_MABX_B.Switch_h; |
| 23352 | |
| 23353 | /* Update for UnitDelay: '<S755>/Unit Delay1' */ |
| 23354 | L4_MABX_DW.UnitDelay1_DSTATE_pn = L4_MABX_B.AND_j; |
| 23355 | |
| 23356 | /* Update for UnitDelay: '<S10>/Unit_Delay' incorporates: |
| 23357 | * Constant: '<S10>/Constant' |
| 23358 | */ |
| 23359 | L4_MABX_DW.Unit_Delay_DSTATE_do = L4_MABX_P.Constant_Value_g5; |
| 23360 | |
| 23361 | /* Update absolute time */ |
| 23362 | /* The "clockTick0" counts the number of times the code of this task has |
| 23363 | * been executed. The absolute time is the multiplication of "clockTick0" |
| 23364 | * and "Timing.stepSize0". Size of "clockTick0" ensures timer will not |
| 23365 | * overflow during the application lifespan selected. |
| 23366 | * Timer of this task consists of two 32 bit unsigned integers. |
| 23367 | * The two integers represent the low bits Timing.clockTick0 and the high bits |
| 23368 | * Timing.clockTickH0. When the low bit overflows to 0, the high bits increment. |
| 23369 | */ |
| 23370 | if (!(++L4_MABX_M->Timing.clockTick0)) { |
| 23371 | ++L4_MABX_M->Timing.clockTickH0; |
| 23372 | } |
| 23373 | |
| 23374 | L4_MABX_M->Timing.t[0] = L4_MABX_M->Timing.clockTick0 * |
| 23375 | L4_MABX_M->Timing.stepSize0 + L4_MABX_M->Timing.clockTickH0 * |
| 23376 | L4_MABX_M->Timing.stepSize0 * 4294967296.0; |
| 23377 | } |
| 23378 | |
| 23379 | /* Model output function for TID1 */ |
| 23380 | void L4_MABX_output1(void) /* Sample time: [0.02s, 0.0s] */ |
| 23381 | { |
| 23382 | int_T tid = 1; |
| 23383 | int32_T i; |
| 23384 | uint32_T q0; |
| 23385 | uint32_T qY; |
| 23386 | uint8_T tmp; |
| 23387 | real_T u0; |
| 23388 | real_T u1; |
| 23389 | real_T u2; |
| 23390 | |
| 23391 | /* Outputs for Atomic SubSystem: '<S855>/CAN_TX_20ms' */ |
| 23392 | |
| 23393 | /* Switch: '<S1021>/Switch1' incorporates: |
| 23394 | * Constant: '<S1021>/Constant4' |
| 23395 | */ |
| 23396 | if (L4_MABX_B.AutonomousOutputEnabled_h) { |
| 23397 | /* Product: '<S1021>/Divide1' incorporates: |
| 23398 | * Constant: '<S1021>/Constant2' |
| 23399 | */ |
| 23400 | L4_MABX_B.XBRExternalAccelDemand_m = L4_MABX_B.BrakingPID_Y_g * |
| 23401 | L4_MABX_P.Constant2_Value_i; |
| 23402 | L4_MABX_B.XBRExternalAccelDemand = L4_MABX_B.XBRExternalAccelDemand_m; |
| 23403 | } else { |
| 23404 | L4_MABX_B.XBRExternalAccelDemand = L4_MABX_P.Constant4_Value_k; |
| 23405 | } |
| 23406 | |
| 23407 | /* End of Switch: '<S1021>/Switch1' */ |
| 23408 | |
| 23409 | /* MultiPortSwitch: '<S1021>/Multiport Switch' incorporates: |
| 23410 | * Constant: '<S1021>/Constant10' |
| 23411 | * Constant: '<S1021>/Constant7' |
| 23412 | * Constant: '<S1021>/Constant8' |
| 23413 | * Constant: '<S1021>/Constant9' |
| 23414 | */ |
| 23415 | switch ((int32_T)L4_MABX_B.BrakingControlActive_b) { |
| 23416 | case 0: |
| 23417 | L4_MABX_B.XBRPassThroughActive = L4_MABX_P.Constant10_Value_hg; |
| 23418 | break; |
| 23419 | |
| 23420 | case 1: |
| 23421 | L4_MABX_B.XBRPassThroughActive = L4_MABX_P.Constant7_Value_g; |
| 23422 | break; |
| 23423 | |
| 23424 | case 2: |
| 23425 | L4_MABX_B.XBRPassThroughActive = L4_MABX_P.Constant8_Value_i; |
| 23426 | break; |
| 23427 | |
| 23428 | default: |
| 23429 | L4_MABX_B.XBRPassThroughActive = L4_MABX_P.Constant9_Value_f; |
| 23430 | break; |
| 23431 | } |
| 23432 | |
| 23433 | /* End of MultiPortSwitch: '<S1021>/Multiport Switch' */ |
| 23434 | |
| 23435 | /* Outputs for Atomic SubSystem: '<S1021>/If_Then_Else' */ |
| 23436 | |
| 23437 | /* Constant: '<S1021>/XBRValueOverride' incorporates: |
| 23438 | * Constant: '<S1021>/XBRControlMode' |
| 23439 | * Constant: '<S1021>/XBRControlModeOVR' |
| 23440 | * Constant: '<S1021>/XBREnduranceBrakeIntegrationMode' |
| 23441 | * Constant: '<S1021>/XBREnduranceBrakeIntegrationModeOVR' |
| 23442 | * Constant: '<S1021>/XBRExternalAccelDemandOVR' |
| 23443 | * Constant: '<S1021>/XBRPassThroughActiveOVR' |
| 23444 | * Constant: '<S1021>/XBRPassThroughEnabled' |
| 23445 | * Constant: '<S1021>/XBRPassThroughEnabledOVR' |
| 23446 | * Constant: '<S1021>/XBRPriority' |
| 23447 | * Constant: '<S1021>/XBRPriorityOVR' |
| 23448 | * Constant: '<S1021>/XBRUrgency' |
| 23449 | * Constant: '<S1021>/XBRUrgencyOVR' |
| 23450 | */ |
| 23451 | L4_MABX_If_Then_Else_b(L4_MABX_P.XBRValueOverride_Value, |
| 23452 | L4_MABX_P.XBRExternalAccelDemandOVR_Value, |
| 23453 | L4_MABX_P.XBREnduranceBrakeIntegrationMod, L4_MABX_P.XBRPriorityOVR_Value, |
| 23454 | L4_MABX_P.XBRControlModeOVR_Value, L4_MABX_P.XBRPassThroughActiveOVR_Value, |
| 23455 | L4_MABX_P.XBRUrgencyOVR_Value, L4_MABX_P.XBRPassThroughEnabledOVR_Value, |
| 23456 | L4_MABX_B.XBRExternalAccelDemand, L4_MABX_P.XBREnduranceBrakeIntegrationM_f, |
| 23457 | L4_MABX_P.XBRPriority_Value, L4_MABX_P.XBRControlMode_Value, |
| 23458 | L4_MABX_B.XBRPassThroughActive, L4_MABX_P.XBRUrgency_Value, |
| 23459 | L4_MABX_P.XBRPassThroughEnabled_Value, &L4_MABX_B.If_Then_Else_b2); |
| 23460 | |
| 23461 | /* End of Outputs for SubSystem: '<S1021>/If_Then_Else' */ |
| 23462 | |
| 23463 | /* DataTypeConversion: '<S1024>/Data Type Conversion1' */ |
| 23464 | L4_MABX_B.DataTypeConversion1_a = (real_T) |
| 23465 | L4_MABX_B.If_Then_Else_b2.XBREnduranceBrakeIntegrationMod; |
| 23466 | |
| 23467 | /* DataTypeConversion: '<S1024>/Data Type Conversion2' */ |
| 23468 | L4_MABX_B.DataTypeConversion2_bk = (real_T) |
| 23469 | L4_MABX_B.If_Then_Else_b2.XBRPriority; |
| 23470 | |
| 23471 | /* DataTypeConversion: '<S1024>/Data Type Conversion3' */ |
| 23472 | L4_MABX_B.DataTypeConversion3_n = (real_T) |
| 23473 | L4_MABX_B.If_Then_Else_b2.XBRControlMode; |
| 23474 | |
| 23475 | /* DataTypeConversion: '<S1024>/Data Type Conversion4' */ |
| 23476 | L4_MABX_B.DataTypeConversion4_i = |
| 23477 | L4_MABX_B.If_Then_Else_b2.XBRExternalAccelDemand; |
| 23478 | |
| 23479 | /* DataTypeConversion: '<S1024>/Data Type Conversion5' */ |
| 23480 | L4_MABX_B.DataTypeConversion5_g = (real_T) |
| 23481 | L4_MABX_B.If_Then_Else_b2.XBRPassThroughActive; |
| 23482 | |
| 23483 | /* DataTypeConversion: '<S1024>/Data Type Conversion6' */ |
| 23484 | L4_MABX_B.DataTypeConversion6_p = L4_MABX_B.If_Then_Else_b2.XBRUrgency; |
| 23485 | |
| 23486 | /* DataTypeConversion: '<S1024>/Data Type Conversion7' */ |
| 23487 | L4_MABX_B.DataTypeConversion7_li = |
| 23488 | L4_MABX_B.If_Then_Else_b2.XBRPassThroughEnabled; |
| 23489 | |
| 23490 | /* UnitDelay: '<S1017>/Unit_Delay' */ |
| 23491 | L4_MABX_B.Unit_Delay_g = L4_MABX_DW.Unit_Delay_DSTATE_j5; |
| 23492 | |
| 23493 | /* Logic: '<S1017>/Logical Operator8' */ |
| 23494 | L4_MABX_B.LogicalOperator8_i = !L4_MABX_B.TmpRTBAtLogicalOperator8Inport1; |
| 23495 | |
| 23496 | /* Logic: '<S1017>/Logical Operator7' */ |
| 23497 | L4_MABX_B.LogicalOperator7_h = (L4_MABX_B.Unit_Delay_g && |
| 23498 | L4_MABX_B.LogicalOperator8_i); |
| 23499 | |
| 23500 | /* Logic: '<S1017>/Logical Operator1' */ |
| 23501 | L4_MABX_B.LogicalOperator1_ct = (L4_MABX_B.LogicalOperator7_h || |
| 23502 | L4_MABX_B.TmpRTBAtLogicalOperator1Inport2); |
| 23503 | |
| 23504 | /* DataTypeConversion: '<S1017>/Data Type Conversion' incorporates: |
| 23505 | * Constant: '<S861>/CANT_PROPB_XBR_B3_CHANNEL_APV' |
| 23506 | */ |
| 23507 | u0 = L4_MABX_P.CANT_PROPB_XBR_B3_CHANNEL_APV_V; |
| 23508 | if (u0 < 256.0) { |
| 23509 | if (u0 >= 0.0) { |
| 23510 | tmp = (uint8_T)u0; |
| 23511 | } else { |
| 23512 | tmp = 0U; |
| 23513 | } |
| 23514 | } else { |
| 23515 | tmp = MAX_uint8_T; |
| 23516 | } |
| 23517 | |
| 23518 | L4_MABX_B.DataTypeConversion_d0 = tmp; |
| 23519 | |
| 23520 | /* End of DataTypeConversion: '<S1017>/Data Type Conversion' */ |
| 23521 | |
| 23522 | /* S-Function (sfix_bitop): '<S1022>/Operator' */ |
| 23523 | L4_MABX_B.Operator_ny = (uint8_T)(L4_MABX_B.DataTypeConversion_d0 & |
| 23524 | L4_MABX_P.Operator_BitMask_go); |
| 23525 | |
| 23526 | /* DataTypeConversion: '<S1022>/DataType' */ |
| 23527 | L4_MABX_B.DataType_fq = L4_MABX_B.Operator_ny; |
| 23528 | |
| 23529 | /* DataTypeConversion: '<S1017>/Data Type Conversion2' */ |
| 23530 | L4_MABX_B.DataTypeConversion2_lv = (L4_MABX_B.DataType_fq != 0); |
| 23531 | |
| 23532 | /* Logic: '<S1017>/Logical Operator' */ |
| 23533 | L4_MABX_B.LogicalOperator_ga = (L4_MABX_B.LogicalOperator1_ct && |
| 23534 | L4_MABX_B.DataTypeConversion2_lv); |
| 23535 | |
| 23536 | /* Outputs for Enabled SubSystem: '<S1024>/PropB_XBR_B3' incorporates: |
| 23537 | * EnablePort: '<S1025>/Enable' |
| 23538 | */ |
| 23539 | if (L4_MABX_B.LogicalOperator_ga) { |
| 23540 | /* S-Function (rti_commonblock): '<S1025>/S-Function1' */ |
| 23541 | /* This comment workarounds a code generation problem */ |
| 23542 | |
| 23543 | /* dSPACE RTICAN TX Message Block: "PropB_XBR_B3" Id:218038707 */ |
| 23544 | { |
| 23545 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 23546 | |
| 23547 | Float32 delayTime = 0.0; |
| 23548 | |
| 23549 | /* ... Read status and timestamp info (previous message) */ |
| 23550 | can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]); |
| 23551 | |
| 23552 | /* Convert timestamp */ |
| 23553 | if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->processed) { |
| 23554 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->timestamp = |
| 23555 | rtk_dsts_time_to_simtime_convert |
| 23556 | (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->timestamp); |
| 23557 | } |
| 23558 | |
| 23559 | /* Messages with timestamp zero have been received in pause/stop state |
| 23560 | and must not be handled. |
| 23561 | */ |
| 23562 | if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->timestamp > 0.0) { |
| 23563 | L4_MABX_B.SFunction1_o1_jl = (real_T) |
| 23564 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->processed; |
| 23565 | L4_MABX_B.SFunction1_o2_ph = (real_T) |
| 23566 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->timestamp; |
| 23567 | L4_MABX_B.SFunction1_o3_b = (real_T) |
| 23568 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->deltatime; |
| 23569 | L4_MABX_B.SFunction1_o4_g = (real_T) |
| 23570 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->delaytime; |
| 23571 | } |
| 23572 | |
| 23573 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 23574 | { |
| 23575 | rtican_Signal_t CAN_Sgn; |
| 23576 | |
| 23577 | /* ...... "SPN2920_ExternalAccelerationDemand" (0|16, standard signal, unsigned int, little endian) */ |
| 23578 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23579 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion4_i - |
| 23580 | ( -15.687 ) ) / 0.00048828125 + 0.5); |
| 23581 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 23582 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 23583 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte1; |
| 23584 | |
| 23585 | /* ...... "SPN2915_XBREnduranceBrkIntegrationMode" (16|2, standard signal, unsigned int, little endian) */ |
| 23586 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23587 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_a ) + |
| 23588 | 0.5); |
| 23589 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 23590 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 23591 | |
| 23592 | /* ...... "SPN2915_XBRPriority" (18|2, standard signal, unsigned int, little endian) */ |
| 23593 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23594 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion2_bk ) + |
| 23595 | 0.5); |
| 23596 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 23597 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 23598 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 23599 | |
| 23600 | /* ...... "SPN2916_XBRControlMode" (20|2, standard signal, unsigned int, little endian) */ |
| 23601 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23602 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion3_n ) + |
| 23603 | 0.5); |
| 23604 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 23605 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 23606 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 23607 | |
| 23608 | /* ...... "XBRPassThroughActive" (22|2, standard signal, unsigned int, little endian) */ |
| 23609 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23610 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion5_g ) + |
| 23611 | 0.5); |
| 23612 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 23613 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 23614 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 23615 | |
| 23616 | /* ...... "SPN4099_XBRUrgency" (24|8, standard signal, unsigned int, little endian) */ |
| 23617 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23618 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion6_p - ( 0 ) |
| 23619 | ) / 0.4 + 0.5); |
| 23620 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 23621 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 23622 | |
| 23623 | /* ...... "XBRPassThroughEnable" (54|2, standard signal, unsigned int, little endian) */ |
| 23624 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23625 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion7_li ) + |
| 23626 | 0.5); |
| 23627 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 23628 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 23629 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 23630 | } |
| 23631 | |
| 23632 | /* mask unused bits with '1' */ |
| 23633 | CAN_Msg[4] |= 0xFF; |
| 23634 | CAN_Msg[5] |= 0xFF; |
| 23635 | CAN_Msg[6] |= 0x3F; |
| 23636 | CAN_Msg[7] |= 0xFF; |
| 23637 | |
| 23638 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 23639 | can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3], 8, |
| 23640 | &(CAN_Msg[0]), delayTime); |
| 23641 | } |
| 23642 | } |
| 23643 | |
| 23644 | /* End of Outputs for SubSystem: '<S1024>/PropB_XBR_B3' */ |
| 23645 | |
| 23646 | /* RelationalOperator: '<S1023>/Compare' incorporates: |
| 23647 | * Constant: '<S1023>/Constant' |
| 23648 | */ |
| 23649 | L4_MABX_B.Compare_it = (L4_MABX_B.If_Then_Else_b2.XBRPassThroughActive == |
| 23650 | L4_MABX_P.CompareToConstant_const_ee); |
| 23651 | |
| 23652 | /* Saturate: '<S1020>/Saturation' incorporates: |
| 23653 | * Constant: '<S1020>/2C2_OR_VALUE_APV' |
| 23654 | */ |
| 23655 | u0 = L4_MABX_P.uC2_OR_VALUE_APV_Value; |
| 23656 | u1 = L4_MABX_P.Saturation_LowerSat_n; |
| 23657 | u2 = L4_MABX_P.Saturation_UpperSat_fc; |
| 23658 | if (u0 > u2) { |
| 23659 | L4_MABX_B.Saturation_n = u2; |
| 23660 | } else if (u0 < u1) { |
| 23661 | L4_MABX_B.Saturation_n = u1; |
| 23662 | } else { |
| 23663 | L4_MABX_B.Saturation_n = u0; |
| 23664 | } |
| 23665 | |
| 23666 | /* End of Saturate: '<S1020>/Saturation' */ |
| 23667 | |
| 23668 | /* Outputs for Atomic SubSystem: '<S1020>/If_Then_Else1' */ |
| 23669 | |
| 23670 | /* Constant: '<S1020>/F_2C2_OR_APV' */ |
| 23671 | L4_MABX_If_Then_Else_g(L4_MABX_P.F_2C2_OR_APV_Value, L4_MABX_B.Saturation_n, |
| 23672 | L4_MABX_B.BrakingPID_Y_gc, &L4_MABX_B.If_Then_Else1_j); |
| 23673 | |
| 23674 | /* End of Outputs for SubSystem: '<S1020>/If_Then_Else1' */ |
| 23675 | |
| 23676 | /* Gain: '<S1020>/Gain' */ |
| 23677 | L4_MABX_B.Gain_d = L4_MABX_P.Gain_Gain_pd * L4_MABX_B.If_Then_Else1_j.Switch; |
| 23678 | |
| 23679 | /* Gain: '<S1037>/Gain' */ |
| 23680 | L4_MABX_B.Gain_b = L4_MABX_P.Gain_Gain_gn * L4_MABX_B.Gain_d; |
| 23681 | |
| 23682 | /* DataTypeConversion: '<S1037>/Data Type Conversion2' */ |
| 23683 | u0 = floor(L4_MABX_B.Gain_b); |
| 23684 | if (rtIsNaN(u0) || rtIsInf(u0)) { |
| 23685 | u0 = 0.0; |
| 23686 | } else { |
| 23687 | u0 = fmod(u0, 256.0); |
| 23688 | } |
| 23689 | |
| 23690 | L4_MABX_B.DataTypeConversion2_ki = (uint8_T)(u0 < 0.0 ? (int32_T)(uint8_T) |
| 23691 | -(int8_T)(uint8_T)-u0 : (int32_T)(uint8_T)u0); |
| 23692 | |
| 23693 | /* End of DataTypeConversion: '<S1037>/Data Type Conversion2' */ |
| 23694 | |
| 23695 | /* DataTypeConversion: '<S1037>/Data Type Conversion3' incorporates: |
| 23696 | * Constant: '<S1020>/BrkControlMode_Active' |
| 23697 | */ |
| 23698 | u0 = floor(L4_MABX_P.BrkControlMode_Active_Value); |
| 23699 | if (rtIsNaN(u0) || rtIsInf(u0)) { |
| 23700 | u0 = 0.0; |
| 23701 | } else { |
| 23702 | u0 = fmod(u0, 256.0); |
| 23703 | } |
| 23704 | |
| 23705 | L4_MABX_B.DataTypeConversion3_imv = (uint8_T)(u0 < 0.0 ? (int32_T)(uint8_T) |
| 23706 | -(int8_T)(uint8_T)-u0 : (int32_T)(uint8_T)u0); |
| 23707 | |
| 23708 | /* End of DataTypeConversion: '<S1037>/Data Type Conversion3' */ |
| 23709 | |
| 23710 | /* S-Function (sfix_bitop): '<S1037>/Bitwise Operator14' */ |
| 23711 | L4_MABX_B.BitwiseOperator14 = (uint8_T)(L4_MABX_B.DataTypeConversion3_imv & |
| 23712 | L4_MABX_P.BitwiseOperator14_BitMask); |
| 23713 | |
| 23714 | /* DataTypeConversion: '<S1037>/Data Type Conversion4' incorporates: |
| 23715 | * Constant: '<S1020>/BrkControlPriority' |
| 23716 | */ |
| 23717 | u0 = floor(L4_MABX_P.BrkControlPriority_Value); |
| 23718 | if (rtIsNaN(u0) || rtIsInf(u0)) { |
| 23719 | u0 = 0.0; |
| 23720 | } else { |
| 23721 | u0 = fmod(u0, 256.0); |
| 23722 | } |
| 23723 | |
| 23724 | L4_MABX_B.DataTypeConversion4_m = (uint8_T)(u0 < 0.0 ? (int32_T)(uint8_T) |
| 23725 | -(int8_T)(uint8_T)-u0 : (int32_T)(uint8_T)u0); |
| 23726 | |
| 23727 | /* End of DataTypeConversion: '<S1037>/Data Type Conversion4' */ |
| 23728 | |
| 23729 | /* S-Function (sfix_bitop): '<S1037>/Bitwise Operator1' */ |
| 23730 | L4_MABX_B.BitwiseOperator1 = (uint8_T)(L4_MABX_B.DataTypeConversion4_m & |
| 23731 | L4_MABX_P.BitwiseOperator1_BitMask); |
| 23732 | |
| 23733 | /* ArithShift: '<S1037>/Shift_Arithmetic ' */ |
| 23734 | L4_MABX_B.Shift_Arithmetic_ckw = (uint8_T)(L4_MABX_B.BitwiseOperator1 << 2); |
| 23735 | |
| 23736 | /* DataTypeConversion: '<S1037>/Data Type Conversion12' */ |
| 23737 | L4_MABX_B.DataTypeConversion12_p = L4_MABX_B.Shift_Arithmetic_ckw; |
| 23738 | |
| 23739 | /* DataTypeConversion: '<S1037>/Data Type Conversion6' incorporates: |
| 23740 | * Constant: '<S1037>/Constant2' |
| 23741 | */ |
| 23742 | L4_MABX_B.DataTypeConversion6_dw = L4_MABX_P.Constant2_Value_al; |
| 23743 | |
| 23744 | /* S-Function (sfix_bitop): '<S1037>/Bitwise Operator17' */ |
| 23745 | L4_MABX_B.BitwiseOperator17_c = (uint8_T)(L4_MABX_B.BitwiseOperator14 | |
| 23746 | L4_MABX_B.DataTypeConversion12_p | L4_MABX_B.DataTypeConversion6_dw); |
| 23747 | |
| 23748 | /* Gain: '<S1037>/Gain1' incorporates: |
| 23749 | * Constant: '<S1020>/BrkControl_RearAxlePressureProportioning' |
| 23750 | */ |
| 23751 | L4_MABX_B.Gain1_p = L4_MABX_P.Gain1_Gain_d * |
| 23752 | L4_MABX_P.BrkControl_RearAxlePressureProp; |
| 23753 | |
| 23754 | /* DataTypeConversion: '<S1037>/Data Type Conversion11' */ |
| 23755 | u0 = floor(L4_MABX_B.Gain1_p); |
| 23756 | if (rtIsNaN(u0) || rtIsInf(u0)) { |
| 23757 | u0 = 0.0; |
| 23758 | } else { |
| 23759 | u0 = fmod(u0, 256.0); |
| 23760 | } |
| 23761 | |
| 23762 | L4_MABX_B.DataTypeConversion11_os = (uint8_T)(u0 < 0.0 ? (int32_T)(uint8_T) |
| 23763 | -(int8_T)(uint8_T)-u0 : (int32_T)(uint8_T)u0); |
| 23764 | |
| 23765 | /* End of DataTypeConversion: '<S1037>/Data Type Conversion11' */ |
| 23766 | |
| 23767 | /* Reshape: '<S1040>/Reshape' incorporates: |
| 23768 | * Constant: '<S1040>/Constant' |
| 23769 | */ |
| 23770 | for (i = 0; i < 16; i++) { |
| 23771 | L4_MABX_B.Reshape_i[i] = L4_MABX_P.Repeating_Sequence_Stair_Out_lc[i]; |
| 23772 | } |
| 23773 | |
| 23774 | /* End of Reshape: '<S1040>/Reshape' */ |
| 23775 | |
| 23776 | /* UnitDelay: '<S1040>/Unit_Delay' */ |
| 23777 | L4_MABX_B.Unit_Delay_iy = L4_MABX_DW.Unit_Delay_DSTATE_f3; |
| 23778 | |
| 23779 | /* UnitDelay: '<S1041>/Unit Delay' */ |
| 23780 | L4_MABX_B.UnitDelay_iw = L4_MABX_DW.UnitDelay_DSTATE_em; |
| 23781 | |
| 23782 | /* Switch: '<S1044>/Switch1' incorporates: |
| 23783 | * Constant: '<S1041>/E' |
| 23784 | * Constant: '<S1041>/IV' |
| 23785 | * Switch: '<S1043>/Switch1' |
| 23786 | */ |
| 23787 | if (L4_MABX_B.Unit_Delay_iy) { |
| 23788 | L4_MABX_B.Switch1_pk = L4_MABX_P.IV_Value_h3; |
| 23789 | } else { |
| 23790 | if (L4_MABX_P.E_Value_mg) { |
| 23791 | /* Sum: '<S1041>/Subtract' incorporates: |
| 23792 | * Constant: '<S1041>/Constant' |
| 23793 | * Switch: '<S1043>/Switch1' |
| 23794 | */ |
| 23795 | q0 = L4_MABX_P.Constant_Value_hp; |
| 23796 | qY = q0 + L4_MABX_B.UnitDelay_iw; |
| 23797 | if (qY < q0) { |
| 23798 | qY = MAX_uint32_T; |
| 23799 | } |
| 23800 | |
| 23801 | L4_MABX_B.Subtract_lm = qY; |
| 23802 | |
| 23803 | /* End of Sum: '<S1041>/Subtract' */ |
| 23804 | |
| 23805 | /* Switch: '<S1043>/Switch1' */ |
| 23806 | L4_MABX_B.Switch1_e = L4_MABX_B.Subtract_lm; |
| 23807 | } else { |
| 23808 | /* Switch: '<S1043>/Switch1' */ |
| 23809 | L4_MABX_B.Switch1_e = L4_MABX_B.UnitDelay_iw; |
| 23810 | } |
| 23811 | |
| 23812 | L4_MABX_B.Switch1_pk = L4_MABX_B.Switch1_e; |
| 23813 | } |
| 23814 | |
| 23815 | /* End of Switch: '<S1044>/Switch1' */ |
| 23816 | |
| 23817 | /* Selector: '<S1040>/Selector' */ |
| 23818 | L4_MABX_B.Selector_l = L4_MABX_B.Reshape_i[(int32_T)L4_MABX_B.Switch1_pk - 1]; |
| 23819 | |
| 23820 | /* DataTypeConversion: '<S1037>/Data Type Conversion10' */ |
| 23821 | L4_MABX_B.DataTypeConversion10_a = L4_MABX_B.Selector_l; |
| 23822 | |
| 23823 | /* S-Function (sfix_bitop): '<S1037>/Bitwise Operator6' */ |
| 23824 | L4_MABX_B.BitwiseOperator6 = (uint8_T)(L4_MABX_B.DataTypeConversion10_a & |
| 23825 | L4_MABX_P.BitwiseOperator6_BitMask); |
| 23826 | |
| 23827 | /* DataTypeConversion: '<S1036>/Data Type Conversion6' incorporates: |
| 23828 | * Constant: '<S1036>/Priority' |
| 23829 | */ |
| 23830 | L4_MABX_B.DataTypeConversion6_n = L4_MABX_P.Priority_Value_e; |
| 23831 | |
| 23832 | /* ArithShift: '<S1036>/Shift_Arithmetic 5' */ |
| 23833 | L4_MABX_B.Shift_Arithmetic5 = L4_MABX_B.DataTypeConversion6_n << 26; |
| 23834 | |
| 23835 | /* DataTypeConversion: '<S1036>/Data Type Conversion7' incorporates: |
| 23836 | * Constant: '<S1036>/ExtendedDataPage' |
| 23837 | */ |
| 23838 | L4_MABX_B.DataTypeConversion7_i = L4_MABX_P.ExtendedDataPage_Value_m; |
| 23839 | |
| 23840 | /* ArithShift: '<S1036>/Shift_Arithmetic 6' */ |
| 23841 | L4_MABX_B.Shift_Arithmetic6 = L4_MABX_B.DataTypeConversion7_i << 25; |
| 23842 | |
| 23843 | /* DataTypeConversion: '<S1036>/Data Type Conversion8' incorporates: |
| 23844 | * Constant: '<S1036>/DataPage' |
| 23845 | */ |
| 23846 | L4_MABX_B.DataTypeConversion8_o = L4_MABX_P.DataPage_Value_a; |
| 23847 | |
| 23848 | /* ArithShift: '<S1036>/Shift_Arithmetic 7' */ |
| 23849 | L4_MABX_B.Shift_Arithmetic7 = L4_MABX_B.DataTypeConversion8_o << 24; |
| 23850 | |
| 23851 | /* DataTypeConversion: '<S1036>/Data Type Conversion9' incorporates: |
| 23852 | * Constant: '<S1036>/PDUFormat' |
| 23853 | */ |
| 23854 | L4_MABX_B.DataTypeConversion9_l = L4_MABX_P.PDUFormat_Value_m; |
| 23855 | |
| 23856 | /* ArithShift: '<S1036>/Shift_Arithmetic 8' */ |
| 23857 | L4_MABX_B.Shift_Arithmetic8 = L4_MABX_B.DataTypeConversion9_l << 16; |
| 23858 | |
| 23859 | /* DataTypeConversion: '<S1036>/Data Type Conversion10' incorporates: |
| 23860 | * Constant: '<S1036>/PDUSpecific' |
| 23861 | */ |
| 23862 | L4_MABX_B.DataTypeConversion10_f = L4_MABX_P.PDUSpecific_Value_f; |
| 23863 | |
| 23864 | /* ArithShift: '<S1036>/Shift_Arithmetic 9' */ |
| 23865 | L4_MABX_B.Shift_Arithmetic9 = L4_MABX_B.DataTypeConversion10_f << 8; |
| 23866 | |
| 23867 | /* DataTypeConversion: '<S1036>/Data Type Conversion11' incorporates: |
| 23868 | * Constant: '<S1036>/SourceAddress' |
| 23869 | */ |
| 23870 | L4_MABX_B.DataTypeConversion11_o = L4_MABX_P.SourceAddress_Value_d; |
| 23871 | |
| 23872 | /* S-Function (sfix_bitop): '<S1036>/Bitwise Operator17' */ |
| 23873 | L4_MABX_B.BitwiseOperator17 = L4_MABX_B.Shift_Arithmetic5 | |
| 23874 | L4_MABX_B.Shift_Arithmetic6 | L4_MABX_B.Shift_Arithmetic7 | |
| 23875 | L4_MABX_B.Shift_Arithmetic8 | L4_MABX_B.Shift_Arithmetic9 | |
| 23876 | L4_MABX_B.DataTypeConversion11_o; |
| 23877 | |
| 23878 | /* DataTypeConversion: '<S1037>/Data Type Conversion7' */ |
| 23879 | L4_MABX_B.DataTypeConversion7_eu = L4_MABX_B.BitwiseOperator17; |
| 23880 | |
| 23881 | /* S-Function (sfix_bitop): '<S1037>/Bitwise Operator2' */ |
| 23882 | L4_MABX_B.BitwiseOperator2 = L4_MABX_B.DataTypeConversion7_eu & |
| 23883 | L4_MABX_P.BitwiseOperator2_BitMask; |
| 23884 | |
| 23885 | /* S-Function (sfix_bitop): '<S1037>/Bitwise Operator3' */ |
| 23886 | L4_MABX_B.BitwiseOperator3 = L4_MABX_B.DataTypeConversion7_eu & |
| 23887 | L4_MABX_P.BitwiseOperator3_BitMask; |
| 23888 | |
| 23889 | /* ArithShift: '<S1037>/Shift_Arithmetic 3' */ |
| 23890 | L4_MABX_B.Shift_Arithmetic3_g = L4_MABX_B.BitwiseOperator3 >> 8; |
| 23891 | |
| 23892 | /* DataTypeConversion: '<S1037>/Data Type Conversion5' */ |
| 23893 | L4_MABX_B.DataTypeConversion5_gj = (uint8_T)L4_MABX_B.Shift_Arithmetic3_g; |
| 23894 | |
| 23895 | /* S-Function (sfix_bitop): '<S1037>/Bitwise Operator4' */ |
| 23896 | L4_MABX_B.BitwiseOperator4 = L4_MABX_B.DataTypeConversion7_eu & |
| 23897 | L4_MABX_P.BitwiseOperator4_BitMask; |
| 23898 | |
| 23899 | /* ArithShift: '<S1037>/Shift_Arithmetic 4' */ |
| 23900 | L4_MABX_B.Shift_Arithmetic4_g = L4_MABX_B.BitwiseOperator4 >> 16; |
| 23901 | |
| 23902 | /* DataTypeConversion: '<S1037>/Data Type Conversion8' */ |
| 23903 | L4_MABX_B.DataTypeConversion8_i = (uint8_T)L4_MABX_B.Shift_Arithmetic4_g; |
| 23904 | |
| 23905 | /* S-Function (sfix_bitop): '<S1037>/Bitwise Operator5' */ |
| 23906 | L4_MABX_B.BitwiseOperator5 = L4_MABX_B.DataTypeConversion7_eu & |
| 23907 | L4_MABX_P.BitwiseOperator5_BitMask; |
| 23908 | |
| 23909 | /* ArithShift: '<S1037>/Shift_Arithmetic 5' */ |
| 23910 | L4_MABX_B.Shift_Arithmetic5_b = L4_MABX_B.BitwiseOperator5 >> 24; |
| 23911 | |
| 23912 | /* DataTypeConversion: '<S1037>/Data Type Conversion9' */ |
| 23913 | L4_MABX_B.DataTypeConversion9_m = (uint8_T)L4_MABX_B.Shift_Arithmetic5_b; |
| 23914 | |
| 23915 | /* Sum: '<S1037>/Add2' incorporates: |
| 23916 | * Constant: '<S1037>/Constant' |
| 23917 | * Constant: '<S1037>/Constant1' |
| 23918 | * Constant: '<S1037>/Constant3' |
| 23919 | * Constant: '<S1037>/Constant4' |
| 23920 | */ |
| 23921 | L4_MABX_B.Add2_d = (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T) |
| 23922 | (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T) |
| 23923 | ((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T) |
| 23924 | (uint8_T)((uint32_T)L4_MABX_B.DataTypeConversion2_ki + |
| 23925 | L4_MABX_B.BitwiseOperator17_c) + L4_MABX_B.DataTypeConversion11_os) |
| 23926 | + L4_MABX_P.Constant3_Value_a) + L4_MABX_P.Constant4_Value_c3) + |
| 23927 | L4_MABX_P.Constant_Value_ls) + L4_MABX_P.Constant1_Value_k) + (uint8_T) |
| 23928 | L4_MABX_B.BitwiseOperator2) + L4_MABX_B.DataTypeConversion5_gj) + |
| 23929 | L4_MABX_B.DataTypeConversion8_i) + L4_MABX_B.DataTypeConversion9_m) + |
| 23930 | L4_MABX_B.BitwiseOperator6); |
| 23931 | |
| 23932 | /* ArithShift: '<S1037>/Shift_Arithmetic 6' */ |
| 23933 | L4_MABX_B.Shift_Arithmetic6_m = (uint8_T)((uint32_T)L4_MABX_B.Add2_d >> 4); |
| 23934 | |
| 23935 | /* Sum: '<S1037>/Add3' */ |
| 23936 | L4_MABX_B.Add3_n = (uint8_T)((uint32_T)L4_MABX_B.Shift_Arithmetic6_m + |
| 23937 | L4_MABX_B.Add2_d); |
| 23938 | |
| 23939 | /* S-Function (sfix_bitop): '<S1037>/Bitwise Operator8' */ |
| 23940 | L4_MABX_B.BitwiseOperator8 = (uint8_T)(L4_MABX_B.Add3_n & |
| 23941 | L4_MABX_P.BitwiseOperator8_BitMask); |
| 23942 | |
| 23943 | /* ArithShift: '<S1037>/Shift_Arithmetic 7' */ |
| 23944 | L4_MABX_B.Shift_Arithmetic7_k = (uint8_T)(L4_MABX_B.BitwiseOperator8 << 4); |
| 23945 | |
| 23946 | /* S-Function (sfix_bitop): '<S1037>/Bitwise Operator7' */ |
| 23947 | L4_MABX_B.BitwiseOperator7 = (uint8_T)(L4_MABX_B.BitwiseOperator6 | |
| 23948 | L4_MABX_B.Shift_Arithmetic7_k); |
| 23949 | |
| 23950 | /* DataTypeConversion: '<S1018>/Data Type Conversion1' incorporates: |
| 23951 | * Constant: '<S1037>/Constant' |
| 23952 | * Constant: '<S1037>/Constant1' |
| 23953 | * Constant: '<S1037>/Constant3' |
| 23954 | * Constant: '<S1037>/Constant4' |
| 23955 | */ |
| 23956 | L4_MABX_B.DataTypeConversion1_o[0] = L4_MABX_B.DataTypeConversion2_ki; |
| 23957 | L4_MABX_B.DataTypeConversion1_o[1] = L4_MABX_B.BitwiseOperator17_c; |
| 23958 | L4_MABX_B.DataTypeConversion1_o[2] = L4_MABX_B.DataTypeConversion11_os; |
| 23959 | L4_MABX_B.DataTypeConversion1_o[3] = L4_MABX_P.Constant3_Value_a; |
| 23960 | L4_MABX_B.DataTypeConversion1_o[4] = L4_MABX_P.Constant4_Value_c3; |
| 23961 | L4_MABX_B.DataTypeConversion1_o[5] = L4_MABX_P.Constant_Value_ls; |
| 23962 | L4_MABX_B.DataTypeConversion1_o[6] = L4_MABX_P.Constant1_Value_k; |
| 23963 | L4_MABX_B.DataTypeConversion1_o[7] = L4_MABX_B.BitwiseOperator7; |
| 23964 | |
| 23965 | /* Outputs for Enabled SubSystem: '<S1026>/PropB_Bendix_2C2_XPR' incorporates: |
| 23966 | * EnablePort: '<S1027>/Enable' |
| 23967 | */ |
| 23968 | /* Constant: '<S1020>/CPV' */ |
| 23969 | if (L4_MABX_P.CPV_Value_lq) { |
| 23970 | /* S-Function (rti_commonblock): '<S1027>/S-Function1' */ |
| 23971 | /* This comment workarounds a code generation problem */ |
| 23972 | |
| 23973 | /* dSPACE RTICAN TX Message Block: "PropB_Bendix_2C2_XPR" Id:218060389 */ |
| 23974 | { |
| 23975 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 23976 | |
| 23977 | Float32 delayTime = 0.0; |
| 23978 | |
| 23979 | /* ... Read status and timestamp info (previous message) */ |
| 23980 | can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]); |
| 23981 | |
| 23982 | /* Convert timestamp */ |
| 23983 | if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->processed) { |
| 23984 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->timestamp = |
| 23985 | rtk_dsts_time_to_simtime_convert |
| 23986 | (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->timestamp); |
| 23987 | } |
| 23988 | |
| 23989 | /* Messages with timestamp zero have been received in pause/stop state |
| 23990 | and must not be handled. |
| 23991 | */ |
| 23992 | if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->timestamp > 0.0) { |
| 23993 | L4_MABX_B.SFunction1_o1_e = (real_T) |
| 23994 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->processed; |
| 23995 | L4_MABX_B.SFunction1_o2_g = (real_T) |
| 23996 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->timestamp; |
| 23997 | L4_MABX_B.SFunction1_o3_d = (real_T) |
| 23998 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->deltatime; |
| 23999 | L4_MABX_B.SFunction1_o4_fw = (real_T) |
| 24000 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->delaytime; |
| 24001 | } |
| 24002 | |
| 24003 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 24004 | { |
| 24005 | rtican_Signal_t CAN_Sgn; |
| 24006 | |
| 24007 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 24008 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24009 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_o[0] ) + |
| 24010 | 0.5); |
| 24011 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 24012 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24013 | |
| 24014 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 24015 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24016 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_o[1] ) + |
| 24017 | 0.5); |
| 24018 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 24019 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 24020 | |
| 24021 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 24022 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24023 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_o[2] ) + |
| 24024 | 0.5); |
| 24025 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 24026 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 24027 | |
| 24028 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 24029 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24030 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_o[3] ) + |
| 24031 | 0.5); |
| 24032 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 24033 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 24034 | |
| 24035 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 24036 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24037 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_o[4] ) + |
| 24038 | 0.5); |
| 24039 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 24040 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24041 | |
| 24042 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 24043 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24044 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_o[5] ) + |
| 24045 | 0.5); |
| 24046 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 24047 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 24048 | |
| 24049 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 24050 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24051 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_o[6] ) + |
| 24052 | 0.5); |
| 24053 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 24054 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 24055 | |
| 24056 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 24057 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24058 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_o[7] ) + |
| 24059 | 0.5); |
| 24060 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 24061 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 24062 | } |
| 24063 | |
| 24064 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 24065 | can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665], 8, |
| 24066 | &(CAN_Msg[0]), delayTime); |
| 24067 | } |
| 24068 | } |
| 24069 | |
| 24070 | /* End of Constant: '<S1020>/CPV' */ |
| 24071 | /* End of Outputs for SubSystem: '<S1026>/PropB_Bendix_2C2_XPR' */ |
| 24072 | |
| 24073 | /* DataTypeConversion: '<S1034>/Data Type Conversion' */ |
| 24074 | L4_MABX_B.DataTypeConversion_lb = L4_MABX_B.FrontAxleSpeed_b; |
| 24075 | |
| 24076 | /* DataTypeConversion: '<S1034>/Data Type Conversion1' */ |
| 24077 | L4_MABX_B.DataTypeConversion1_l = L4_MABX_B.SPN1807_SteeringWheelAngle_g; |
| 24078 | |
| 24079 | /* DataTypeConversion: '<S1034>/Data Type Conversion2' */ |
| 24080 | L4_MABX_B.DataTypeConversion2_k = L4_MABX_B.SPN1808_YawRate_i; |
| 24081 | |
| 24082 | /* DataTypeConversion: '<S1034>/Data Type Conversion3' */ |
| 24083 | L4_MABX_B.DataTypeConversion3_j = L4_MABX_B.SPN1810_LongitudinalAccelerat_i; |
| 24084 | |
| 24085 | /* DataTypeConversion: '<S1019>/Data Type Conversion' incorporates: |
| 24086 | * Constant: '<S861>/CANT_STD_ODOMETRY_CHANNEL_APV' |
| 24087 | */ |
| 24088 | L4_MABX_B.DataTypeConversion_p3 = (uint8_T) |
| 24089 | L4_MABX_P.CANT_STD_ODOMETRY_CHANNEL_APV_V; |
| 24090 | |
| 24091 | /* S-Function (sfix_bitop): '<S1033>/Operator' */ |
| 24092 | L4_MABX_B.Operator_pf = (uint8_T)(L4_MABX_B.DataTypeConversion_p3 & |
| 24093 | L4_MABX_P.Operator_BitMask_ej); |
| 24094 | |
| 24095 | /* DataTypeConversion: '<S1033>/DataType' */ |
| 24096 | L4_MABX_B.DataType = L4_MABX_B.Operator_pf; |
| 24097 | |
| 24098 | /* ArithShift: '<S1019>/Shift_Arithmetic 4' */ |
| 24099 | L4_MABX_B.Shift_Arithmetic4 = ldexp(L4_MABX_B.DataType, (-5)); |
| 24100 | |
| 24101 | /* DataTypeConversion: '<S1019>/Data Type Conversion7' */ |
| 24102 | L4_MABX_B.DataTypeConversion7_hf = (L4_MABX_B.Shift_Arithmetic4 != 0.0); |
| 24103 | |
| 24104 | /* Outputs for Enabled SubSystem: '<S1034>/Std_OdometryData' incorporates: |
| 24105 | * EnablePort: '<S1035>/Enable' |
| 24106 | */ |
| 24107 | if (L4_MABX_B.DataTypeConversion7_hf) { |
| 24108 | /* S-Function (rti_commonblock): '<S1035>/S-Function1' */ |
| 24109 | /* This comment workarounds a code generation problem */ |
| 24110 | |
| 24111 | /* dSPACE RTICAN TX Message Block: "Std_OdometryData" Id:10 */ |
| 24112 | { |
| 24113 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 24114 | |
| 24115 | Float32 delayTime = 0.0; |
| 24116 | |
| 24117 | /* ... Read status and timestamp info (previous message) */ |
| 24118 | can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]); |
| 24119 | |
| 24120 | /* Convert timestamp */ |
| 24121 | if (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->processed) { |
| 24122 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->timestamp = |
| 24123 | rtk_dsts_time_to_simtime_convert |
| 24124 | (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->timestamp); |
| 24125 | } |
| 24126 | |
| 24127 | /* Messages with timestamp zero have been received in pause/stop state |
| 24128 | and must not be handled. |
| 24129 | */ |
| 24130 | if (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->timestamp > 0.0) { |
| 24131 | L4_MABX_B.SFunction1_o1_b = (real_T) |
| 24132 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->processed; |
| 24133 | L4_MABX_B.SFunction1_o2_f = (real_T) |
| 24134 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->timestamp; |
| 24135 | L4_MABX_B.SFunction1_o3_ed = (real_T) |
| 24136 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->deltatime; |
| 24137 | L4_MABX_B.SFunction1_o4_fk = (real_T) |
| 24138 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->delaytime; |
| 24139 | } |
| 24140 | |
| 24141 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 24142 | { |
| 24143 | rtican_Signal_t CAN_Sgn; |
| 24144 | |
| 24145 | /* ...... "SPN904_FrontAxleSpeed" (0|16, standard signal, unsigned int, little endian) */ |
| 24146 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24147 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_lb - ( 0 ) |
| 24148 | ) / 0.00390625 + 0.5); |
| 24149 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 24150 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24151 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte1; |
| 24152 | |
| 24153 | /* ...... "SPN1807_SteeringWheelAngle" (16|16, standard signal, unsigned int, little endian) */ |
| 24154 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24155 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_l - |
| 24156 | ( -31.374 ) ) / 0.0009765625 + 0.5); |
| 24157 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 24158 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 24159 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte1; |
| 24160 | |
| 24161 | /* ...... "SPN1808_YawRate" (32|16, standard signal, unsigned int, little endian) */ |
| 24162 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24163 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion2_k - |
| 24164 | ( -3.92 ) ) / 0.0001220703125 + 0.5); |
| 24165 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 24166 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24167 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte1; |
| 24168 | |
| 24169 | /* ...... "SPN1810_LongitudinalAcceleration" (48|8, standard signal, unsigned int, little endian) */ |
| 24170 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24171 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion3_j - |
| 24172 | ( -12.5 ) ) / 0.1 + 0.5); |
| 24173 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 24174 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 24175 | } |
| 24176 | |
| 24177 | /* mask unused bits with '1' */ |
| 24178 | CAN_Msg[7] |= 0xFF; |
| 24179 | |
| 24180 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 24181 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA], 8, &(CAN_Msg[0]), |
| 24182 | delayTime); |
| 24183 | } |
| 24184 | } |
| 24185 | |
| 24186 | /* End of Outputs for SubSystem: '<S1034>/Std_OdometryData' */ |
| 24187 | |
| 24188 | /* S-Function (sfix_bitop): '<S1028>/Operator' */ |
| 24189 | L4_MABX_B.Operator_b1 = (uint8_T)(L4_MABX_B.DataTypeConversion_p3 & |
| 24190 | L4_MABX_P.Operator_BitMask_iv); |
| 24191 | |
| 24192 | /* DataTypeConversion: '<S1028>/DataType' */ |
| 24193 | L4_MABX_B.DataType_jh = L4_MABX_B.Operator_b1; |
| 24194 | |
| 24195 | /* S-Function (sfix_bitop): '<S1029>/Operator' */ |
| 24196 | L4_MABX_B.Operator_du = (uint8_T)(L4_MABX_B.DataTypeConversion_p3 & |
| 24197 | L4_MABX_P.Operator_BitMask_a5); |
| 24198 | |
| 24199 | /* DataTypeConversion: '<S1029>/DataType' */ |
| 24200 | L4_MABX_B.DataType_e = L4_MABX_B.Operator_du; |
| 24201 | |
| 24202 | /* S-Function (sfix_bitop): '<S1030>/Operator' */ |
| 24203 | L4_MABX_B.Operator_eal = (uint8_T)(L4_MABX_B.DataTypeConversion_p3 & |
| 24204 | L4_MABX_P.Operator_BitMask_cl0); |
| 24205 | |
| 24206 | /* DataTypeConversion: '<S1030>/DataType' */ |
| 24207 | L4_MABX_B.DataType_i = L4_MABX_B.Operator_eal; |
| 24208 | |
| 24209 | /* S-Function (sfix_bitop): '<S1031>/Operator' */ |
| 24210 | L4_MABX_B.Operator_mi = (uint8_T)(L4_MABX_B.DataTypeConversion_p3 & |
| 24211 | L4_MABX_P.Operator_BitMask_bv); |
| 24212 | |
| 24213 | /* DataTypeConversion: '<S1031>/DataType' */ |
| 24214 | L4_MABX_B.DataType_b = L4_MABX_B.Operator_mi; |
| 24215 | |
| 24216 | /* S-Function (sfix_bitop): '<S1032>/Operator' */ |
| 24217 | L4_MABX_B.Operator_lh = (uint8_T)(L4_MABX_B.DataTypeConversion_p3 & |
| 24218 | L4_MABX_P.Operator_BitMask_jn); |
| 24219 | |
| 24220 | /* DataTypeConversion: '<S1032>/DataType' */ |
| 24221 | L4_MABX_B.DataType_l = L4_MABX_B.Operator_lh; |
| 24222 | |
| 24223 | /* DataTypeConversion: '<S1019>/Data Type Conversion2' */ |
| 24224 | L4_MABX_B.DataTypeConversion2_a3 = (L4_MABX_B.DataType_jh != 0); |
| 24225 | |
| 24226 | /* ArithShift: '<S1019>/Shift_Arithmetic ' */ |
| 24227 | L4_MABX_B.Shift_Arithmetic = ldexp(L4_MABX_B.DataType_e, (-1)); |
| 24228 | |
| 24229 | /* DataTypeConversion: '<S1019>/Data Type Conversion3' */ |
| 24230 | L4_MABX_B.DataTypeConversion3_pb = (L4_MABX_B.Shift_Arithmetic != 0.0); |
| 24231 | |
| 24232 | /* ArithShift: '<S1019>/Shift_Arithmetic 1' */ |
| 24233 | L4_MABX_B.Shift_Arithmetic1 = ldexp(L4_MABX_B.DataType_i, (-2)); |
| 24234 | |
| 24235 | /* DataTypeConversion: '<S1019>/Data Type Conversion4' */ |
| 24236 | L4_MABX_B.DataTypeConversion4_p = (L4_MABX_B.Shift_Arithmetic1 != 0.0); |
| 24237 | |
| 24238 | /* ArithShift: '<S1019>/Shift_Arithmetic 2' */ |
| 24239 | L4_MABX_B.Shift_Arithmetic2 = ldexp(L4_MABX_B.DataType_b, (-3)); |
| 24240 | |
| 24241 | /* DataTypeConversion: '<S1019>/Data Type Conversion5' */ |
| 24242 | L4_MABX_B.DataTypeConversion5_pu = (L4_MABX_B.Shift_Arithmetic2 != 0.0); |
| 24243 | |
| 24244 | /* ArithShift: '<S1019>/Shift_Arithmetic 3' */ |
| 24245 | L4_MABX_B.Shift_Arithmetic3 = ldexp(L4_MABX_B.DataType_l, (-4)); |
| 24246 | |
| 24247 | /* DataTypeConversion: '<S1019>/Data Type Conversion6' */ |
| 24248 | L4_MABX_B.DataTypeConversion6_bk = (L4_MABX_B.Shift_Arithmetic3 != 0.0); |
| 24249 | |
| 24250 | /* RelationalOperator: '<S1042>/Operator' */ |
| 24251 | L4_MABX_B.Operator_ao = (L4_MABX_B.Switch1_pk == L4_MABX_B.Width_h); |
| 24252 | |
| 24253 | /* Lookup_n-D: '<S1021>/DECEL_GOV_XBR_URGENCY_MPV' */ |
| 24254 | L4_MABX_B.XBRUrgency = look1_binlcapw(L4_MABX_B.XBRExternalAccelDemand, |
| 24255 | L4_MABX_P.DECEL_GOV_XBR_URGENCY_MPV_bp01D, |
| 24256 | L4_MABX_P.DECEL_GOV_XBR_URGENCY_MPV_table, 7U); |
| 24257 | |
| 24258 | /* End of Outputs for SubSystem: '<S855>/CAN_TX_20ms' */ |
| 24259 | |
| 24260 | /* Outputs for Atomic SubSystem: '<S65>/Task_20ms' */ |
| 24261 | /* RelationalOperator: '<S401>/CheckHDOP' incorporates: |
| 24262 | * Constant: '<S401>/MaximumGoodHDOP' |
| 24263 | */ |
| 24264 | L4_MABX_B.CheckHDOP = (L4_MABX_B.HDOP__f <= L4_MABX_P.MaximumGoodHDOP_Value); |
| 24265 | |
| 24266 | /* Gain: '<S401>/kph2mps' */ |
| 24267 | L4_MABX_B.kph2mps = L4_MABX_P.kph2mps_Gain_l * L4_MABX_B.FrontAxleSpeed_d; |
| 24268 | |
| 24269 | /* Product: '<S401>/Product' incorporates: |
| 24270 | * Constant: '<S401>/lookAheadTime' |
| 24271 | */ |
| 24272 | L4_MABX_B.Product_c = L4_MABX_B.kph2mps * L4_MABX_P.lookAheadTime_Value; |
| 24273 | |
| 24274 | /* Gain: '<S401>/kph2mps1' */ |
| 24275 | L4_MABX_B.kph2mps1 = L4_MABX_P.kph2mps1_Gain * L4_MABX_B.FrontAxleSpeed_dv; |
| 24276 | |
| 24277 | /* Product: '<S401>/Product1' incorporates: |
| 24278 | * Constant: '<S401>/lookAheadTime1' |
| 24279 | */ |
| 24280 | L4_MABX_B.Product1_h = L4_MABX_B.kph2mps1 * L4_MABX_P.lookAheadTime1_Value; |
| 24281 | |
| 24282 | /* UnitDelay: '<S401>/Unit Delay1' */ |
| 24283 | L4_MABX_B.UnitDelay1 = L4_MABX_DW.UnitDelay1_DSTATE; |
| 24284 | |
| 24285 | /* Constant: '<S402>/InitialHeading' */ |
| 24286 | L4_MABX_B.InitialHeading = L4_MABX_P.InitialHeading_Value; |
| 24287 | |
| 24288 | /* Constant: '<S402>/InitialPosition' */ |
| 24289 | L4_MABX_B.InitialPosition = L4_MABX_P.InitialPosition_Value; |
| 24290 | |
| 24291 | /* Constant: '<S402>/InitialXPosition' */ |
| 24292 | L4_MABX_B.InitialXPosition = L4_MABX_P.InitialXPosition_Value; |
| 24293 | |
| 24294 | /* Constant: '<S402>/InitialYPosition' */ |
| 24295 | L4_MABX_B.InitialYPosition = L4_MABX_P.InitialYPosition_Value; |
| 24296 | |
| 24297 | /* Gain: '<S71>/kph2ms' */ |
| 24298 | L4_MABX_B.kph2ms = L4_MABX_P.kph2ms_Gain * L4_MABX_B.FrontAxleSpeed_dvq; |
| 24299 | |
| 24300 | /* DiscreteIntegrator: '<S402>/LongitudnalPosition' incorporates: |
| 24301 | * Constant: '<S401>/Constant' |
| 24302 | */ |
| 24303 | if ((L4_MABX_P.Constant_Value_p > 0.0) && |
| 24304 | (L4_MABX_DW.LongitudnalPosition_PrevResetSt <= 0)) { |
| 24305 | L4_MABX_DW.LongitudnalPosition_DSTATE = L4_MABX_B.InitialPosition; |
| 24306 | } |
| 24307 | |
| 24308 | L4_MABX_B.LongitudnalPosition = L4_MABX_P.LongitudnalPosition_gainval * |
| 24309 | L4_MABX_B.kph2ms + L4_MABX_DW.LongitudnalPosition_DSTATE; |
| 24310 | |
| 24311 | /* End of DiscreteIntegrator: '<S402>/LongitudnalPosition' */ |
| 24312 | |
| 24313 | /* Trigonometry: '<S402>/Trigonometric Function' */ |
| 24314 | L4_MABX_B.TrigonometricFunction = sin(L4_MABX_B.kph2ms); |
| 24315 | |
| 24316 | /* Trigonometry: '<S402>/Trigonometric Function1' */ |
| 24317 | L4_MABX_B.TrigonometricFunction1 = cos(L4_MABX_B.kph2ms); |
| 24318 | |
| 24319 | /* DiscreteIntegrator: '<S402>/VehHeading' incorporates: |
| 24320 | * Constant: '<S402>/reset' |
| 24321 | */ |
| 24322 | if ((L4_MABX_P.reset_Value > 0.0) && (L4_MABX_DW.VehHeading_PrevResetState <= |
| 24323 | 0)) { |
| 24324 | L4_MABX_DW.VehHeading_DSTATE = L4_MABX_B.InitialHeading; |
| 24325 | } |
| 24326 | |
| 24327 | L4_MABX_B.VehHeading = L4_MABX_P.VehHeading_gainval * |
| 24328 | L4_MABX_B.TmpRTBAtVehHeadingInport1 + L4_MABX_DW.VehHeading_DSTATE; |
| 24329 | |
| 24330 | /* End of DiscreteIntegrator: '<S402>/VehHeading' */ |
| 24331 | |
| 24332 | /* DiscreteIntegrator: '<S402>/XPosition' incorporates: |
| 24333 | * Constant: '<S402>/reset' |
| 24334 | */ |
| 24335 | if ((L4_MABX_P.reset_Value > 0.0) && (L4_MABX_DW.XPosition_PrevResetState <= 0)) |
| 24336 | { |
| 24337 | L4_MABX_DW.XPosition_DSTATE = L4_MABX_B.InitialXPosition; |
| 24338 | } |
| 24339 | |
| 24340 | L4_MABX_B.XPosition = L4_MABX_P.XPosition_gainval * |
| 24341 | L4_MABX_B.TrigonometricFunction1 + L4_MABX_DW.XPosition_DSTATE; |
| 24342 | |
| 24343 | /* End of DiscreteIntegrator: '<S402>/XPosition' */ |
| 24344 | |
| 24345 | /* DiscreteIntegrator: '<S402>/YPosition' incorporates: |
| 24346 | * Constant: '<S402>/reset' |
| 24347 | */ |
| 24348 | if ((L4_MABX_P.reset_Value > 0.0) && (L4_MABX_DW.YPosition_PrevResetState <= 0)) |
| 24349 | { |
| 24350 | L4_MABX_DW.YPosition_DSTATE = L4_MABX_B.InitialYPosition; |
| 24351 | } |
| 24352 | |
| 24353 | L4_MABX_B.YPosition = L4_MABX_P.YPosition_gainval * |
| 24354 | L4_MABX_B.TrigonometricFunction + L4_MABX_DW.YPosition_DSTATE; |
| 24355 | |
| 24356 | /* End of DiscreteIntegrator: '<S402>/YPosition' */ |
| 24357 | /* End of Outputs for SubSystem: '<S65>/Task_20ms' */ |
| 24358 | |
| 24359 | /* UnitDelay: '<S3>/Unit_Delay' */ |
| 24360 | L4_MABX_B.S = L4_MABX_DW.Unit_Delay_49_DSTATE; |
| 24361 | L4_MABX_B.B = L4_MABX_DW.Unit_Delay_50_DSTATE; |
| 24362 | L4_MABX_B.X = L4_MABX_DW.Unit_Delay_51_DSTATE; |
| 24363 | L4_MABX_B.Y = L4_MABX_DW.Unit_Delay_52_DSTATE; |
| 24364 | L4_MABX_B.pathCurveOffset = L4_MABX_DW.Unit_Delay_53_DSTATE; |
| 24365 | L4_MABX_B.S_b = L4_MABX_DW.Unit_Delay_54_DSTATE; |
| 24366 | L4_MABX_B.distanceSpdTarget = L4_MABX_DW.Unit_Delay_55_DSTATE; |
| 24367 | L4_MABX_B.state = L4_MABX_DW.Unit_Delay_56_DSTATE; |
| 24368 | L4_MABX_B.lastWayPointIdx = L4_MABX_DW.Unit_Delay_57_DSTATE; |
| 24369 | L4_MABX_B.crossed = L4_MABX_DW.Unit_Delay_58_DSTATE; |
| 24370 | L4_MABX_B.minimumDist = L4_MABX_DW.Unit_Delay_59_DSTATE; |
| 24371 | L4_MABX_B.SrefOnthisPath = L4_MABX_DW.Unit_Delay_60_DSTATE; |
| 24372 | L4_MABX_B.StartDist = L4_MABX_DW.Unit_Delay_61_DSTATE; |
| 24373 | L4_MABX_B.minDistIdx = L4_MABX_DW.Unit_Delay_62_DSTATE; |
| 24374 | L4_MABX_B.pathS = L4_MABX_DW.Unit_Delay_63_DSTATE; |
| 24375 | L4_MABX_B.pathLat = L4_MABX_DW.Unit_Delay_64_DSTATE; |
| 24376 | L4_MABX_B.pathLong = L4_MABX_DW.Unit_Delay_65_DSTATE; |
| 24377 | L4_MABX_B.pathSteeringAngle = L4_MABX_DW.Unit_Delay_66_DSTATE; |
| 24378 | L4_MABX_B.pathSpdLimit = L4_MABX_DW.Unit_Delay_67_DSTATE; |
| 24379 | L4_MABX_B.distance = L4_MABX_DW.Unit_Delay_68_DSTATE; |
| 24380 | L4_MABX_B.idx = L4_MABX_DW.Unit_Delay_69_DSTATE; |
| 24381 | L4_MABX_B.wpidx = L4_MABX_DW.Unit_Delay_70_DSTATE; |
| 24382 | L4_MABX_B.pathOffset = L4_MABX_DW.Unit_Delay_71_DSTATE; |
| 24383 | L4_MABX_B.sRefDistance = L4_MABX_DW.Unit_Delay_72_DSTATE; |
| 24384 | L4_MABX_B.refDistance = L4_MABX_DW.Unit_Delay_73_DSTATE; |
| 24385 | L4_MABX_B.wpIdx = L4_MABX_DW.Unit_Delay_74_DSTATE; |
| 24386 | L4_MABX_B.previewSteeringAngle_l = L4_MABX_DW.Unit_Delay_75_DSTATE; |
| 24387 | L4_MABX_B.desHeading = L4_MABX_DW.Unit_Delay_76_DSTATE; |
| 24388 | L4_MABX_B.actPreviewDist = L4_MABX_DW.Unit_Delay_77_DSTATE; |
| 24389 | L4_MABX_B.desPreviewDist = L4_MABX_DW.Unit_Delay_78_DSTATE; |
| 24390 | L4_MABX_B.mappingSearchCase = L4_MABX_DW.Unit_Delay_79_DSTATE; |
| 24391 | |
| 24392 | /* user code (Output function Trailer for TID1) */ |
| 24393 | |
| 24394 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 24395 | /* EventChannel: 0 */ |
| 24396 | if (tid == 0) { |
| 24397 | DSXCP_service(0); |
| 24398 | } |
| 24399 | |
| 24400 | /* If subsystem generates rate grouping Output functions, |
| 24401 | * when tid is used in Output function for one rate, |
| 24402 | * all Output functions include tid as a local variable. |
| 24403 | * As result, some Output functions may have unused tid. |
| 24404 | */ |
| 24405 | UNUSED_PARAMETER(tid); |
| 24406 | } |
| 24407 | |
| 24408 | /* Model update function for TID1 */ |
| 24409 | void L4_MABX_update1(void) /* Sample time: [0.02s, 0.0s] */ |
| 24410 | { |
| 24411 | /* Update for Atomic SubSystem: '<S65>/Task_10ms' */ |
| 24412 | /* Update for RateTransition: '<S81>/TmpRTBAtSignal Conversion1Inport1' incorporates: |
| 24413 | * Constant: '<S401>/Constant2' |
| 24414 | */ |
| 24415 | L4_MABX_DW.TmpRTBAtSignalConversion1Inport = L4_MABX_P.Constant2_Value_a; |
| 24416 | |
| 24417 | /* Update for RateTransition: '<S81>/TmpRTBAtSignal Conversion3Inport1' incorporates: |
| 24418 | * Constant: '<S401>/Constant13' |
| 24419 | */ |
| 24420 | L4_MABX_DW.TmpRTBAtSignalConversion3Inport = L4_MABX_P.Constant13_Value; |
| 24421 | |
| 24422 | /* Update for RateTransition: '<S81>/TmpRTBAtSignal Conversion2Inport1' incorporates: |
| 24423 | * Constant: '<S401>/Constant14' |
| 24424 | */ |
| 24425 | L4_MABX_DW.TmpRTBAtSignalConversion2Inport = L4_MABX_P.Constant14_Value; |
| 24426 | |
| 24427 | /* Update for RateTransition: '<S80>/TmpRTBAtrad2deg1Inport1' incorporates: |
| 24428 | * Constant: '<S401>/Constant17' |
| 24429 | */ |
| 24430 | L4_MABX_DW.TmpRTBAtrad2deg1Inport1_Buffer0 = L4_MABX_P.Constant17_Value; |
| 24431 | |
| 24432 | /* Update for RateTransition: '<S80>/TmpRTBAtsignCurveOffsetInport1' incorporates: |
| 24433 | * Constant: '<S401>/Constant1' |
| 24434 | */ |
| 24435 | L4_MABX_DW.TmpRTBAtsignCurveOffsetInport1_ = L4_MABX_P.Constant1_Value_g; |
| 24436 | |
| 24437 | /* Update for RateTransition: '<S284>/TmpRTBAtAdd2Inport2' incorporates: |
| 24438 | * Constant: '<S401>/Constant18' |
| 24439 | */ |
| 24440 | L4_MABX_DW.TmpRTBAtAdd2Inport2_Buffer0 = L4_MABX_P.Constant18_Value; |
| 24441 | |
| 24442 | /* End of Update for SubSystem: '<S65>/Task_10ms' */ |
| 24443 | |
| 24444 | /* Update for Atomic SubSystem: '<S855>/CAN_TX_20ms' */ |
| 24445 | |
| 24446 | /* Update for UnitDelay: '<S1017>/Unit_Delay' */ |
| 24447 | L4_MABX_DW.Unit_Delay_DSTATE_j5 = L4_MABX_B.TmpRTBAtUnit_DelayInport1; |
| 24448 | |
| 24449 | /* Update for UnitDelay: '<S1040>/Unit_Delay' */ |
| 24450 | L4_MABX_DW.Unit_Delay_DSTATE_f3 = L4_MABX_B.Operator_ao; |
| 24451 | |
| 24452 | /* Update for UnitDelay: '<S1041>/Unit Delay' */ |
| 24453 | L4_MABX_DW.UnitDelay_DSTATE_em = L4_MABX_B.Switch1_pk; |
| 24454 | |
| 24455 | /* End of Update for SubSystem: '<S855>/CAN_TX_20ms' */ |
| 24456 | |
| 24457 | /* Update for Atomic SubSystem: '<S65>/Task_20ms' */ |
| 24458 | /* Update for UnitDelay: '<S401>/Unit Delay1' */ |
| 24459 | L4_MABX_DW.UnitDelay1_DSTATE = L4_MABX_B.LongitudnalPosition; |
| 24460 | |
| 24461 | /* Update for DiscreteIntegrator: '<S402>/LongitudnalPosition' incorporates: |
| 24462 | * Constant: '<S401>/Constant' |
| 24463 | */ |
| 24464 | L4_MABX_DW.LongitudnalPosition_DSTATE = L4_MABX_P.LongitudnalPosition_gainval * |
| 24465 | L4_MABX_B.kph2ms + L4_MABX_B.LongitudnalPosition; |
| 24466 | if (L4_MABX_P.Constant_Value_p > 0.0) { |
| 24467 | L4_MABX_DW.LongitudnalPosition_PrevResetSt = 1; |
| 24468 | } else if (L4_MABX_P.Constant_Value_p < 0.0) { |
| 24469 | L4_MABX_DW.LongitudnalPosition_PrevResetSt = -1; |
| 24470 | } else if (L4_MABX_P.Constant_Value_p == 0.0) { |
| 24471 | L4_MABX_DW.LongitudnalPosition_PrevResetSt = 0; |
| 24472 | } else { |
| 24473 | L4_MABX_DW.LongitudnalPosition_PrevResetSt = 2; |
| 24474 | } |
| 24475 | |
| 24476 | /* End of Update for DiscreteIntegrator: '<S402>/LongitudnalPosition' */ |
| 24477 | |
| 24478 | /* Update for DiscreteIntegrator: '<S402>/VehHeading' incorporates: |
| 24479 | * Constant: '<S402>/reset' |
| 24480 | * DiscreteIntegrator: '<S402>/XPosition' |
| 24481 | */ |
| 24482 | L4_MABX_DW.VehHeading_DSTATE = L4_MABX_P.VehHeading_gainval * |
| 24483 | L4_MABX_B.TmpRTBAtVehHeadingInport1 + L4_MABX_B.VehHeading; |
| 24484 | if (L4_MABX_P.reset_Value > 0.0) { |
| 24485 | L4_MABX_DW.VehHeading_PrevResetState = 1; |
| 24486 | L4_MABX_DW.XPosition_PrevResetState = 1; |
| 24487 | } else { |
| 24488 | if (L4_MABX_P.reset_Value < 0.0) { |
| 24489 | L4_MABX_DW.VehHeading_PrevResetState = -1; |
| 24490 | } else if (L4_MABX_P.reset_Value == 0.0) { |
| 24491 | L4_MABX_DW.VehHeading_PrevResetState = 0; |
| 24492 | } else { |
| 24493 | L4_MABX_DW.VehHeading_PrevResetState = 2; |
| 24494 | } |
| 24495 | |
| 24496 | if (L4_MABX_P.reset_Value < 0.0) { |
| 24497 | L4_MABX_DW.XPosition_PrevResetState = -1; |
| 24498 | } else if (L4_MABX_P.reset_Value == 0.0) { |
| 24499 | L4_MABX_DW.XPosition_PrevResetState = 0; |
| 24500 | } else { |
| 24501 | L4_MABX_DW.XPosition_PrevResetState = 2; |
| 24502 | } |
| 24503 | } |
| 24504 | |
| 24505 | /* End of Update for DiscreteIntegrator: '<S402>/VehHeading' */ |
| 24506 | |
| 24507 | /* Update for DiscreteIntegrator: '<S402>/XPosition' */ |
| 24508 | L4_MABX_DW.XPosition_DSTATE = L4_MABX_P.XPosition_gainval * |
| 24509 | L4_MABX_B.TrigonometricFunction1 + L4_MABX_B.XPosition; |
| 24510 | |
| 24511 | /* Update for DiscreteIntegrator: '<S402>/YPosition' incorporates: |
| 24512 | * Constant: '<S402>/reset' |
| 24513 | */ |
| 24514 | L4_MABX_DW.YPosition_DSTATE = L4_MABX_P.YPosition_gainval * |
| 24515 | L4_MABX_B.TrigonometricFunction + L4_MABX_B.YPosition; |
| 24516 | if (L4_MABX_P.reset_Value > 0.0) { |
| 24517 | L4_MABX_DW.YPosition_PrevResetState = 1; |
| 24518 | } else if (L4_MABX_P.reset_Value < 0.0) { |
| 24519 | L4_MABX_DW.YPosition_PrevResetState = -1; |
| 24520 | } else if (L4_MABX_P.reset_Value == 0.0) { |
| 24521 | L4_MABX_DW.YPosition_PrevResetState = 0; |
| 24522 | } else { |
| 24523 | L4_MABX_DW.YPosition_PrevResetState = 2; |
| 24524 | } |
| 24525 | |
| 24526 | /* End of Update for DiscreteIntegrator: '<S402>/YPosition' */ |
| 24527 | /* End of Update for SubSystem: '<S65>/Task_20ms' */ |
| 24528 | |
| 24529 | /* Update for UnitDelay: '<S3>/Unit_Delay' incorporates: |
| 24530 | * Constant: '<S401>/Constant1' |
| 24531 | * Constant: '<S401>/Constant10' |
| 24532 | * Constant: '<S401>/Constant11' |
| 24533 | * Constant: '<S401>/Constant12' |
| 24534 | * Constant: '<S401>/Constant13' |
| 24535 | * Constant: '<S401>/Constant14' |
| 24536 | * Constant: '<S401>/Constant15' |
| 24537 | * Constant: '<S401>/Constant16' |
| 24538 | * Constant: '<S401>/Constant17' |
| 24539 | * Constant: '<S401>/Constant18' |
| 24540 | * Constant: '<S401>/Constant19' |
| 24541 | * Constant: '<S401>/Constant2' |
| 24542 | * Constant: '<S401>/Constant20' |
| 24543 | * Constant: '<S401>/Constant21' |
| 24544 | * Constant: '<S401>/Constant22' |
| 24545 | * Constant: '<S401>/Constant23' |
| 24546 | * Constant: '<S401>/Constant24' |
| 24547 | * Constant: '<S401>/Constant25' |
| 24548 | * Constant: '<S401>/Constant3' |
| 24549 | * Constant: '<S401>/Constant4' |
| 24550 | * Constant: '<S401>/Constant5' |
| 24551 | * Constant: '<S401>/Constant6' |
| 24552 | * Constant: '<S401>/Constant7' |
| 24553 | * Constant: '<S401>/Constant8' |
| 24554 | * Constant: '<S401>/Constant9' |
| 24555 | */ |
| 24556 | L4_MABX_DW.Unit_Delay_49_DSTATE = L4_MABX_B.LongitudnalPosition; |
| 24557 | L4_MABX_DW.Unit_Delay_50_DSTATE = L4_MABX_B.VehHeading; |
| 24558 | L4_MABX_DW.Unit_Delay_51_DSTATE = L4_MABX_B.XPosition; |
| 24559 | L4_MABX_DW.Unit_Delay_52_DSTATE = L4_MABX_B.YPosition; |
| 24560 | L4_MABX_DW.Unit_Delay_53_DSTATE = L4_MABX_P.Constant1_Value_g; |
| 24561 | L4_MABX_DW.Unit_Delay_54_DSTATE = L4_MABX_B.UnitDelay1; |
| 24562 | L4_MABX_DW.Unit_Delay_55_DSTATE = L4_MABX_P.Constant2_Value_a; |
| 24563 | L4_MABX_DW.Unit_Delay_56_DSTATE = L4_MABX_P.Constant3_Value_l; |
| 24564 | L4_MABX_DW.Unit_Delay_57_DSTATE = L4_MABX_P.Constant4_Value_m; |
| 24565 | L4_MABX_DW.Unit_Delay_58_DSTATE = L4_MABX_P.Constant5_Value_b; |
| 24566 | L4_MABX_DW.Unit_Delay_59_DSTATE = L4_MABX_P.Constant10_Value_h; |
| 24567 | L4_MABX_DW.Unit_Delay_60_DSTATE = L4_MABX_P.Constant25_Value; |
| 24568 | L4_MABX_DW.Unit_Delay_61_DSTATE = L4_MABX_P.Constant6_Value_e; |
| 24569 | L4_MABX_DW.Unit_Delay_62_DSTATE = L4_MABX_P.Constant7_Value; |
| 24570 | L4_MABX_DW.Unit_Delay_63_DSTATE = L4_MABX_P.Constant8_Value; |
| 24571 | L4_MABX_DW.Unit_Delay_64_DSTATE = L4_MABX_P.Constant9_Value_m; |
| 24572 | L4_MABX_DW.Unit_Delay_65_DSTATE = L4_MABX_P.Constant11_Value; |
| 24573 | L4_MABX_DW.Unit_Delay_66_DSTATE = L4_MABX_P.Constant12_Value; |
| 24574 | L4_MABX_DW.Unit_Delay_67_DSTATE = L4_MABX_P.Constant13_Value; |
| 24575 | L4_MABX_DW.Unit_Delay_68_DSTATE = L4_MABX_P.Constant14_Value; |
| 24576 | L4_MABX_DW.Unit_Delay_69_DSTATE = L4_MABX_P.Constant19_Value_m; |
| 24577 | L4_MABX_DW.Unit_Delay_70_DSTATE = L4_MABX_P.Constant16_Value; |
| 24578 | L4_MABX_DW.Unit_Delay_71_DSTATE = L4_MABX_P.Constant21_Value_g; |
| 24579 | L4_MABX_DW.Unit_Delay_72_DSTATE = L4_MABX_P.Constant22_Value; |
| 24580 | L4_MABX_DW.Unit_Delay_73_DSTATE = L4_MABX_P.Constant15_Value; |
| 24581 | L4_MABX_DW.Unit_Delay_74_DSTATE = L4_MABX_P.Constant20_Value_i; |
| 24582 | L4_MABX_DW.Unit_Delay_75_DSTATE = L4_MABX_P.Constant17_Value; |
| 24583 | L4_MABX_DW.Unit_Delay_76_DSTATE = L4_MABX_P.Constant18_Value; |
| 24584 | L4_MABX_DW.Unit_Delay_77_DSTATE = L4_MABX_P.Constant23_Value; |
| 24585 | L4_MABX_DW.Unit_Delay_78_DSTATE = L4_MABX_B.Product_c; |
| 24586 | L4_MABX_DW.Unit_Delay_79_DSTATE = L4_MABX_P.Constant24_Value; |
| 24587 | } |
| 24588 | |
| 24589 | /* Model output function for TID2 */ |
| 24590 | void L4_MABX_output2(void) /* Sample time: [0.05s, 0.0s] */ |
| 24591 | { |
| 24592 | int_T tid = 2; |
| 24593 | |
| 24594 | /* Outputs for Atomic SubSystem: '<S855>/CAN_TX_50ms' */ |
| 24595 | |
| 24596 | /* Outputs for Enabled SubSystem: '<S1060>/CCVS1_E3' incorporates: |
| 24597 | * EnablePort: '<S1062>/Enable' |
| 24598 | */ |
| 24599 | /* Constant: '<S864>/enable_CAN_TX_CCVS1_CAN3' */ |
| 24600 | if (L4_MABX_P.enable_CAN_TX_CCVS1_CAN3_Value > 0.0) { |
| 24601 | /* S-Function (rti_commonblock): '<S1062>/S-Function1' */ |
| 24602 | /* This comment workarounds a code generation problem */ |
| 24603 | |
| 24604 | /* dSPACE RTICAN TX Message Block: "CCVS1_E3" Id:419361251 */ |
| 24605 | { |
| 24606 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 24607 | |
| 24608 | Float32 delayTime = 0.0; |
| 24609 | |
| 24610 | /* ... Read status and timestamp info (previous message) */ |
| 24611 | can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]); |
| 24612 | |
| 24613 | /* Convert timestamp */ |
| 24614 | if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->processed) { |
| 24615 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->timestamp = |
| 24616 | rtk_dsts_time_to_simtime_convert |
| 24617 | (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->timestamp); |
| 24618 | } |
| 24619 | |
| 24620 | /* Messages with timestamp zero have been received in pause/stop state |
| 24621 | and must not be handled. |
| 24622 | */ |
| 24623 | if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->timestamp > 0.0) { |
| 24624 | L4_MABX_B.SFunction1_o1_kr = (real_T) |
| 24625 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->processed; |
| 24626 | L4_MABX_B.SFunction1_o2_p = (real_T) |
| 24627 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->timestamp; |
| 24628 | L4_MABX_B.SFunction1_o3_m = (real_T) |
| 24629 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->deltatime; |
| 24630 | L4_MABX_B.SFunction1_o4_h = (real_T) |
| 24631 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->delaytime; |
| 24632 | } |
| 24633 | |
| 24634 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 24635 | { |
| 24636 | rtican_Signal_t CAN_Sgn; |
| 24637 | |
| 24638 | /* ...... "SPN69_TwoSpeedAxleSwitch" (0|2, standard signal, unsigned int, little endian) */ |
| 24639 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24640 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.TwoSpeedAxleSwitch ) + 0.5); |
| 24641 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24642 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24643 | |
| 24644 | /* ...... "SPN70_ParkingBrakeSwitch" (2|2, standard signal, unsigned int, little endian) */ |
| 24645 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24646 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkingBrakeSwitch ) + 0.5); |
| 24647 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24648 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24649 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24650 | |
| 24651 | /* ...... "SPN1633_CruiseControlPauseSwitch" (4|2, standard signal, unsigned int, little endian) */ |
| 24652 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24653 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlPauseSwitch ) + |
| 24654 | 0.5); |
| 24655 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24656 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 24657 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24658 | |
| 24659 | /* ...... "SPN3807_ParkBrakeReleaseInhReq" (6|2, standard signal, unsigned int, little endian) */ |
| 24660 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24661 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkBrakeReleaseInhibitRq ) |
| 24662 | + 0.5); |
| 24663 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24664 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24665 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24666 | |
| 24667 | /* ...... "SPN84_WheelBasedVehicleSpeed" (8|16, standard signal, unsigned int, little endian) */ |
| 24668 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24669 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.WheelBasedVehicleSpeed_p - ( |
| 24670 | 0 ) ) / 0.00390625 + 0.5); |
| 24671 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 24672 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 24673 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte1; |
| 24674 | |
| 24675 | /* ...... "SPN595_CruiseControlActive" (24|2, standard signal, unsigned int, little endian) */ |
| 24676 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24677 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlActive ) + 0.5); |
| 24678 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24679 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 24680 | |
| 24681 | /* ...... "SPN596_CruiseControlEnableSwitch" (26|2, standard signal, unsigned int, little endian) */ |
| 24682 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24683 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlEnableSwitch_n ) + |
| 24684 | 0.5); |
| 24685 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24686 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24687 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 24688 | |
| 24689 | /* ...... "SPN597_BrakeSwitch" (28|2, standard signal, unsigned int, little endian) */ |
| 24690 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24691 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.BrakeSwitch_n ) + 0.5); |
| 24692 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24693 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 24694 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 24695 | |
| 24696 | /* ...... "SPN598_ClutchSwitch" (30|2, standard signal, unsigned int, little endian) */ |
| 24697 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24698 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ClutchSwitch ) + 0.5); |
| 24699 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24700 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24701 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 24702 | |
| 24703 | /* ...... "SPN599_CruiseControlSetSwitch" (32|2, standard signal, unsigned int, little endian) */ |
| 24704 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24705 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSwitch ) + 0.5); |
| 24706 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24707 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24708 | |
| 24709 | /* ...... "SPN600_CruiseControlCoastDecelSw" (34|2, standard signal, unsigned int, little endian) */ |
| 24710 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24711 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlCoastSwitch ) + |
| 24712 | 0.5); |
| 24713 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24714 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24715 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24716 | |
| 24717 | /* ...... "SPN601_CruiseControlResumeSwitch" (36|2, standard signal, unsigned int, little endian) */ |
| 24718 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24719 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlResumeSwitch ) + |
| 24720 | 0.5); |
| 24721 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24722 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 24723 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24724 | |
| 24725 | /* ...... "SPN602_CruiseControlAccelerateSw" (38|2, standard signal, unsigned int, little endian) */ |
| 24726 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24727 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlAccelerateSwitch ) |
| 24728 | + 0.5); |
| 24729 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24730 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24731 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24732 | |
| 24733 | /* ...... "SPN86_CruiseControlSetSpeed" (40|8, standard signal, unsigned int, little endian) */ |
| 24734 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24735 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSpeed ) + 0.5); |
| 24736 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 24737 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 24738 | |
| 24739 | /* ...... "SPN976_PTOGovernorState" (48|5, standard signal, unsigned int, little endian) */ |
| 24740 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24741 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.PTOGovernorState ) + 0.5); |
| 24742 | CAN_Sgn.UnsignedSgn &= 0x0000001F; |
| 24743 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 24744 | |
| 24745 | /* ...... "SPN527_CruiseControlStates" (53|3, standard signal, unsigned int, little endian) */ |
| 24746 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24747 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlStates ) + 0.5); |
| 24748 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 24749 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 5; |
| 24750 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 24751 | |
| 24752 | /* ...... "SPN968_EngIdleIncrementSw" (56|2, standard signal, unsigned int, little endian) */ |
| 24753 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24754 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleIncrementSwitch ) + |
| 24755 | 0.5); |
| 24756 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24757 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 24758 | |
| 24759 | /* ...... "SPN967_EngIdleDecrementSwitch" (58|2, standard signal, unsigned int, little endian) */ |
| 24760 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24761 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleDecrementSwitch ) + |
| 24762 | 0.5); |
| 24763 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24764 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24765 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 24766 | |
| 24767 | /* ...... "SPN966_EngDiagTestModeSwitch" (60|2, standard signal, unsigned int, little endian) */ |
| 24768 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24769 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngTestModeSwitch ) + 0.5); |
| 24770 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24771 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 24772 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 24773 | |
| 24774 | /* ...... "SPN1237_EngShutdownOvrdSwitch" (62|2, standard signal, unsigned int, little endian) */ |
| 24775 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24776 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngShutdownOverrideSwitch ) |
| 24777 | + 0.5); |
| 24778 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24779 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24780 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 24781 | } |
| 24782 | |
| 24783 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 24784 | can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3], 8, |
| 24785 | &(CAN_Msg[0]), delayTime); |
| 24786 | } |
| 24787 | } |
| 24788 | |
| 24789 | /* End of Constant: '<S864>/enable_CAN_TX_CCVS1_CAN3' */ |
| 24790 | /* End of Outputs for SubSystem: '<S1060>/CCVS1_E3' */ |
| 24791 | |
| 24792 | /* Outputs for Enabled SubSystem: '<S1061>/TC1_03_05' incorporates: |
| 24793 | * EnablePort: '<S1063>/Enable' |
| 24794 | */ |
| 24795 | /* Constant: '<S1061>/CANT_TC1_03_05_APV' */ |
| 24796 | if (L4_MABX_P.CANT_TC1_03_05_APV_Value) { |
| 24797 | /* S-Function (rti_commonblock): '<S1063>/S-Function1' */ |
| 24798 | /* This comment workarounds a code generation problem */ |
| 24799 | |
| 24800 | /* dSPACE RTICAN TX Message Block: "TC1_03_05" Id:201392901 */ |
| 24801 | { |
| 24802 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 24803 | |
| 24804 | Float32 delayTime = 0.0; |
| 24805 | |
| 24806 | /* ... Read status and timestamp info (previous message) */ |
| 24807 | can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]); |
| 24808 | |
| 24809 | /* Convert timestamp */ |
| 24810 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->processed) { |
| 24811 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->timestamp = |
| 24812 | rtk_dsts_time_to_simtime_convert |
| 24813 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->timestamp); |
| 24814 | } |
| 24815 | |
| 24816 | /* Messages with timestamp zero have been received in pause/stop state |
| 24817 | and must not be handled. |
| 24818 | */ |
| 24819 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->timestamp > 0.0) { |
| 24820 | L4_MABX_B.SFunction1_o1_a = (real_T) |
| 24821 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->processed; |
| 24822 | L4_MABX_B.SFunction1_o2_h = (real_T) |
| 24823 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->timestamp; |
| 24824 | L4_MABX_B.SFunction1_o3_e = (real_T) |
| 24825 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->deltatime; |
| 24826 | L4_MABX_B.SFunction1_o4_f = (real_T) |
| 24827 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->delaytime; |
| 24828 | } |
| 24829 | |
| 24830 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 24831 | { |
| 24832 | rtican_Signal_t CAN_Sgn; |
| 24833 | |
| 24834 | /* ...... "SPN681_TransGearShiftInhibitReq" (0|2, standard signal, unsigned int, little endian) */ |
| 24835 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24836 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24837 | (( L4_MABX_B.SPN681_TransGearShiftInhibitReq ) + 0.5); |
| 24838 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24839 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24840 | |
| 24841 | /* ...... "SPN682_TransTrqConvLockupDisReq" (2|2, standard signal, unsigned int, little endian) */ |
| 24842 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24843 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24844 | (( L4_MABX_B.SPN682_TransTrqConvLockupDisReq ) + 0.5); |
| 24845 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24846 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24847 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24848 | |
| 24849 | /* ...... "SPN683_DisengageDrivelineReq" (4|2, standard signal, unsigned int, little endian) */ |
| 24850 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24851 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN683_DisengageDrivelineReq |
| 24852 | ) + 0.5); |
| 24853 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24854 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 24855 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24856 | |
| 24857 | /* ...... "SPN4242_TransRevGearShiftInhibRq" (6|2, standard signal, unsigned int, little endian) */ |
| 24858 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24859 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24860 | (( L4_MABX_B.SPN4242_TransRevGearShiftInhibR ) + 0.5); |
| 24861 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24862 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24863 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24864 | |
| 24865 | /* ...... "SPN684_RequestedPercClutchSlip" (8|8, standard signal, unsigned int, little endian) */ |
| 24866 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24867 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24868 | (( L4_MABX_B.SPN684_RequestedPercClutchSlip - ( 0 ) ) / 0.4 + 0.5); |
| 24869 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 24870 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 24871 | |
| 24872 | /* ...... "SPN525_TransRequestedGear" (16|8, standard signal, unsigned int, little endian) */ |
| 24873 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24874 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.SPN525_TransRequestedGear - ( |
| 24875 | -125 ) + 0.5); |
| 24876 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 24877 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 24878 | |
| 24879 | /* ...... "SPN685_DisengageDiffLockRqFrAx1" (24|2, standard signal, unsigned int, little endian) */ |
| 24880 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24881 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24882 | (( L4_MABX_B.SPN685_DisengageDiffLockRqFrAx1 ) + 0.5); |
| 24883 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24884 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 24885 | |
| 24886 | /* ...... "SPN686_DisengageDiffLockRqFrAx2" (26|2, standard signal, unsigned int, little endian) */ |
| 24887 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24888 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24889 | (( L4_MABX_B.SPN686_DisengageDiffLockRqFrAx2 ) + 0.5); |
| 24890 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24891 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24892 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 24893 | |
| 24894 | /* ...... "SPN687_DisengageDiffLockRqRrAx1" (28|2, standard signal, unsigned int, little endian) */ |
| 24895 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24896 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24897 | (( L4_MABX_B.SPN687_DisengageDiffLockRqRrAx1 ) + 0.5); |
| 24898 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24899 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 24900 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 24901 | |
| 24902 | /* ...... "SPN688_DisengageDiffLockRqRrAx2" (30|2, standard signal, unsigned int, little endian) */ |
| 24903 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24904 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24905 | (( L4_MABX_B.SPN688_DisengageDiffLockRqRrAx2 ) + 0.5); |
| 24906 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24907 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24908 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 24909 | |
| 24910 | /* ...... "SPN689_DisengageDiffLockRqC" (32|2, standard signal, unsigned int, little endian) */ |
| 24911 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24912 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN689_DisengageDiffLockRqC ) |
| 24913 | + 0.5); |
| 24914 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24915 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24916 | |
| 24917 | /* ...... "SPN690_DisengageDiffLockRqCF" (34|2, standard signal, unsigned int, little endian) */ |
| 24918 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24919 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN690_DisengageDiffLockRqCF |
| 24920 | ) + 0.5); |
| 24921 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24922 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24923 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24924 | |
| 24925 | /* ...... "SPN691_DisengageDiffLockRqCR" (36|2, standard signal, unsigned int, little endian) */ |
| 24926 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24927 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN691_DisengageDiffLockRqCR |
| 24928 | ) + 0.5); |
| 24929 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24930 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 24931 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24932 | |
| 24933 | /* ...... "SPN5762_TransLoadRedInhibitRq" (38|2, standard signal, unsigned int, little endian) */ |
| 24934 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24935 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24936 | (( L4_MABX_B.SPN5762_TransLoadRedInhibitRq ) + 0.5); |
| 24937 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24938 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24939 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24940 | |
| 24941 | /* ...... "SPN1852_TransmissionMode1" (40|2, standard signal, unsigned int, little endian) */ |
| 24942 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24943 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN1852_TransmissionMode1 ) |
| 24944 | + 0.5); |
| 24945 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24946 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 24947 | |
| 24948 | /* ...... "SPN1853_TransmissionMode2" (42|2, standard signal, unsigned int, little endian) */ |
| 24949 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24950 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN1853_TransmissionMode2 ) |
| 24951 | + 0.5); |
| 24952 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24953 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24954 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 24955 | |
| 24956 | /* ...... "SPN1854_TransmissionMode3" (44|2, standard signal, unsigned int, little endian) */ |
| 24957 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24958 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN1854_TransmissionMode3 ) |
| 24959 | + 0.5); |
| 24960 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24961 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 24962 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 24963 | |
| 24964 | /* ...... "SPN1855_TransmissionMode4" (46|2, standard signal, unsigned int, little endian) */ |
| 24965 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24966 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN1855_TransmissionMode4 ) |
| 24967 | + 0.5); |
| 24968 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24969 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24970 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 24971 | |
| 24972 | /* ...... "SPN7695_TransAutoNeutralRequest" (48|2, standard signal, unsigned int, little endian) */ |
| 24973 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24974 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24975 | (( L4_MABX_B.SPN7695_TransAutoNeutralRequest ) + 0.5); |
| 24976 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24977 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 24978 | |
| 24979 | /* ...... "SPN4255_TransRequestedLaunchGear" (50|4, standard signal, unsigned int, little endian) */ |
| 24980 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24981 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24982 | (( L4_MABX_B.SPN4255_TransRequestedLaunchGea ) + 0.5); |
| 24983 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 24984 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24985 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 24986 | |
| 24987 | /* ...... "SPN2985_TransShiftSelDispModeSw" (54|2, standard signal, unsigned int, little endian) */ |
| 24988 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24989 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24990 | (( L4_MABX_B.SPN2985_TransShiftSelDispModeSw ) + 0.5); |
| 24991 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24992 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24993 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 24994 | |
| 24995 | /* ...... "SPN4246_TransmissionMode5" (56|2, standard signal, unsigned int, little endian) */ |
| 24996 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24997 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN4246_TransmissionMode5 ) |
| 24998 | + 0.5); |
| 24999 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25000 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 25001 | |
| 25002 | /* ...... "SPN4247_TransmissionMode6" (58|2, standard signal, unsigned int, little endian) */ |
| 25003 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25004 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN4247_TransmissionMode6 ) |
| 25005 | + 0.5); |
| 25006 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25007 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 25008 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 25009 | |
| 25010 | /* ...... "SPN4248_TransmissionMode7" (60|2, standard signal, unsigned int, little endian) */ |
| 25011 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25012 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN4248_TransmissionMode7 ) |
| 25013 | + 0.5); |
| 25014 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25015 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 25016 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 25017 | |
| 25018 | /* ...... "SPN4249_TransmissionMode8" (62|2, standard signal, unsigned int, little endian) */ |
| 25019 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25020 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN4249_TransmissionMode8 ) |
| 25021 | + 0.5); |
| 25022 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25023 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 25024 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 25025 | } |
| 25026 | |
| 25027 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 25028 | can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305], 8, |
| 25029 | &(CAN_Msg[0]), delayTime); |
| 25030 | } |
| 25031 | } |
| 25032 | |
| 25033 | /* End of Constant: '<S1061>/CANT_TC1_03_05_APV' */ |
| 25034 | /* End of Outputs for SubSystem: '<S1061>/TC1_03_05' */ |
| 25035 | |
| 25036 | /* End of Outputs for SubSystem: '<S855>/CAN_TX_50ms' */ |
| 25037 | /* user code (Output function Trailer for TID2) */ |
| 25038 | |
| 25039 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 25040 | /* EventChannel: 0 */ |
| 25041 | if (tid == 0) { |
| 25042 | DSXCP_service(0); |
| 25043 | } |
| 25044 | |
| 25045 | /* If subsystem generates rate grouping Output functions, |
| 25046 | * when tid is used in Output function for one rate, |
| 25047 | * all Output functions include tid as a local variable. |
| 25048 | * As result, some Output functions may have unused tid. |
| 25049 | */ |
| 25050 | UNUSED_PARAMETER(tid); |
| 25051 | } |
| 25052 | |
| 25053 | /* Model update function for TID2 */ |
| 25054 | void L4_MABX_update2(void) /* Sample time: [0.05s, 0.0s] */ |
| 25055 | { |
| 25056 | /* (no update code required) */ |
| 25057 | } |
| 25058 | |
| 25059 | /* Model output function for TID3 */ |
| 25060 | void L4_MABX_output3(void) /* Sample time: [0.1s, 0.0s] */ |
| 25061 | { |
| 25062 | int_T tid = 3; |
| 25063 | uint16_T tmp; |
| 25064 | uint32_T tmp_0; |
| 25065 | uint8_T tmp_1; |
| 25066 | real_T tmp_2; |
| 25067 | |
| 25068 | /* Outputs for Atomic SubSystem: '<S855>/CAN_TX_100ms' */ |
| 25069 | |
| 25070 | /* DataTypeConversion: '<S892>/Data Type Conversion' incorporates: |
| 25071 | * Constant: '<S859>/PROPB_XPR_INHIBIT_PARK_MANUAL_APV' |
| 25072 | */ |
| 25073 | L4_MABX_B.DataTypeConversion_pk = (uint8_T) |
| 25074 | L4_MABX_P.PROPB_XPR_INHIBIT_PARK_MANUAL_A; |
| 25075 | |
| 25076 | /* S-Function (sfix_bitop): '<S924>/Operator' */ |
| 25077 | L4_MABX_B.Operator_nz = (uint8_T)(L4_MABX_B.DataTypeConversion_pk & |
| 25078 | L4_MABX_P.Operator_BitMask_a); |
| 25079 | |
| 25080 | /* DataTypeConversion: '<S924>/DataType' */ |
| 25081 | L4_MABX_B.DataType_is = L4_MABX_B.Operator_nz; |
| 25082 | |
| 25083 | /* DataTypeConversion: '<S892>/Data Type Conversion2' incorporates: |
| 25084 | * Constant: '<S859>/PROPB_XPR_INHIBIT_UNPARK_MANUAL_APV' |
| 25085 | */ |
| 25086 | L4_MABX_B.DataTypeConversion2_a2j = (uint8_T) |
| 25087 | L4_MABX_P.PROPB_XPR_INHIBIT_UNPARK_MANUAL; |
| 25088 | |
| 25089 | /* S-Function (sfix_bitop): '<S926>/Operator' */ |
| 25090 | L4_MABX_B.Operator_f4 = (uint8_T)(L4_MABX_B.DataTypeConversion2_a2j & |
| 25091 | L4_MABX_P.Operator_BitMask_l); |
| 25092 | |
| 25093 | /* DataTypeConversion: '<S926>/DataType' */ |
| 25094 | L4_MABX_B.DataType_lm = L4_MABX_B.Operator_f4; |
| 25095 | |
| 25096 | /* ArithShift: '<S892>/Shift_Arithmetic ' */ |
| 25097 | L4_MABX_B.Shift_Arithmetic_jl = (uint8_T)(L4_MABX_B.DataType_lm << 2); |
| 25098 | |
| 25099 | /* DataTypeConversion: '<S892>/Data Type Conversion4' incorporates: |
| 25100 | * Constant: '<S859>/PROPB_XPR_PARK_MANUAL_APV' |
| 25101 | */ |
| 25102 | L4_MABX_B.DataTypeConversion4_k = (uint8_T) |
| 25103 | L4_MABX_P.PROPB_XPR_PARK_MANUAL_APV_Value; |
| 25104 | |
| 25105 | /* S-Function (sfix_bitop): '<S927>/Operator' */ |
| 25106 | L4_MABX_B.Operator_mst = (uint8_T)(L4_MABX_B.DataTypeConversion4_k & |
| 25107 | L4_MABX_P.Operator_BitMask_kv); |
| 25108 | |
| 25109 | /* DataTypeConversion: '<S927>/DataType' */ |
| 25110 | L4_MABX_B.DataType_d3 = L4_MABX_B.Operator_mst; |
| 25111 | |
| 25112 | /* ArithShift: '<S892>/Shift_Arithmetic 1' */ |
| 25113 | L4_MABX_B.Shift_Arithmetic1_k1 = (uint8_T)(L4_MABX_B.DataType_d3 << 4); |
| 25114 | |
| 25115 | /* DataTypeConversion: '<S892>/Data Type Conversion5' incorporates: |
| 25116 | * Constant: '<S859>/PROPB_XPR_UNPARK_MANUAL_APV' |
| 25117 | */ |
| 25118 | L4_MABX_B.DataTypeConversion5_n = (uint8_T) |
| 25119 | L4_MABX_P.PROPB_XPR_UNPARK_MANUAL_APV_Val; |
| 25120 | |
| 25121 | /* S-Function (sfix_bitop): '<S925>/Operator' */ |
| 25122 | L4_MABX_B.Operator_mp = (uint8_T)(L4_MABX_B.DataTypeConversion5_n & |
| 25123 | L4_MABX_P.Operator_BitMask_lj); |
| 25124 | |
| 25125 | /* DataTypeConversion: '<S925>/DataType' */ |
| 25126 | L4_MABX_B.DataType_mr = L4_MABX_B.Operator_mp; |
| 25127 | |
| 25128 | /* ArithShift: '<S892>/Shift_Arithmetic 2' */ |
| 25129 | L4_MABX_B.Shift_Arithmetic2_jb = (uint8_T)(L4_MABX_B.DataType_mr << 6); |
| 25130 | |
| 25131 | /* S-Function (sfix_bitop): '<S932>/Operator' */ |
| 25132 | L4_MABX_B.Operator_h5 = (uint8_T)(L4_MABX_B.DataType_is | |
| 25133 | L4_MABX_B.Shift_Arithmetic_jl | L4_MABX_B.Shift_Arithmetic1_k1 | |
| 25134 | L4_MABX_B.Shift_Arithmetic2_jb); |
| 25135 | |
| 25136 | /* DataTypeConversion: '<S932>/DataType' */ |
| 25137 | L4_MABX_B.DataType_ib = L4_MABX_B.Operator_h5; |
| 25138 | |
| 25139 | /* Outputs for Enabled SubSystem: '<S892>/Rolling_15_counter' incorporates: |
| 25140 | * EnablePort: '<S934>/Enable' |
| 25141 | */ |
| 25142 | if (L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_R) { |
| 25143 | /* UnitDelay: '<S934>/Unit_Delay' */ |
| 25144 | L4_MABX_B.Unit_Delay = L4_MABX_DW.Unit_Delay_DSTATE; |
| 25145 | |
| 25146 | /* Sum: '<S942>/FixPt Sum1' incorporates: |
| 25147 | * Constant: '<S942>/FixPt Constant' |
| 25148 | */ |
| 25149 | L4_MABX_B.FixPtSum1_pc = L4_MABX_B.Unit_Delay + |
| 25150 | L4_MABX_P.FixPtConstant_Value; |
| 25151 | |
| 25152 | /* Switch: '<S943>/FixPt Switch' incorporates: |
| 25153 | * Constant: '<S943>/Constant' |
| 25154 | */ |
| 25155 | if (L4_MABX_B.FixPtSum1_pc > L4_MABX_P.WrapToZero1_Threshold) { |
| 25156 | L4_MABX_B.FixPtSwitch = L4_MABX_P.Constant_Value_j; |
| 25157 | } else { |
| 25158 | L4_MABX_B.FixPtSwitch = L4_MABX_B.FixPtSum1_pc; |
| 25159 | } |
| 25160 | |
| 25161 | /* End of Switch: '<S943>/FixPt Switch' */ |
| 25162 | } |
| 25163 | |
| 25164 | /* End of Outputs for SubSystem: '<S892>/Rolling_15_counter' */ |
| 25165 | |
| 25166 | /* DataTypeConversion: '<S892>/Data Type Conversion1' */ |
| 25167 | tmp_2 = L4_MABX_B.Unit_Delay; |
| 25168 | if (tmp_2 < 256.0) { |
| 25169 | if (tmp_2 >= 0.0) { |
| 25170 | tmp_1 = (uint8_T)tmp_2; |
| 25171 | } else { |
| 25172 | tmp_1 = 0U; |
| 25173 | } |
| 25174 | } else { |
| 25175 | tmp_1 = MAX_uint8_T; |
| 25176 | } |
| 25177 | |
| 25178 | L4_MABX_B.DataTypeConversion1_og = tmp_1; |
| 25179 | |
| 25180 | /* End of DataTypeConversion: '<S892>/Data Type Conversion1' */ |
| 25181 | |
| 25182 | /* S-Function (sfix_bitop): '<S928>/Operator' */ |
| 25183 | L4_MABX_B.Operator_m0 = (uint8_T)(L4_MABX_B.DataTypeConversion1_og & |
| 25184 | L4_MABX_P.Operator_BitMask_d2); |
| 25185 | |
| 25186 | /* DataTypeConversion: '<S928>/DataType' */ |
| 25187 | L4_MABX_B.DataType_hu = L4_MABX_B.Operator_m0; |
| 25188 | |
| 25189 | /* DataTypeConversion: '<S931>/Data Type Conversion' incorporates: |
| 25190 | * Constant: '<S931>/Priority' |
| 25191 | */ |
| 25192 | L4_MABX_B.DataTypeConversion_c2 = L4_MABX_P.Priority_Value; |
| 25193 | |
| 25194 | /* ArithShift: '<S931>/Shift_Arithmetic ' */ |
| 25195 | L4_MABX_B.Shift_Arithmetic_jv = L4_MABX_B.DataTypeConversion_c2 << 26; |
| 25196 | |
| 25197 | /* DataTypeConversion: '<S931>/Data Type Conversion1' incorporates: |
| 25198 | * Constant: '<S931>/ExtendedDataPage' |
| 25199 | */ |
| 25200 | L4_MABX_B.DataTypeConversion1_hd = L4_MABX_P.ExtendedDataPage_Value; |
| 25201 | |
| 25202 | /* ArithShift: '<S931>/Shift_Arithmetic 1' */ |
| 25203 | L4_MABX_B.Shift_Arithmetic1_g2 = L4_MABX_B.DataTypeConversion1_hd << 25; |
| 25204 | |
| 25205 | /* DataTypeConversion: '<S931>/Data Type Conversion2' incorporates: |
| 25206 | * Constant: '<S931>/DataPage' |
| 25207 | */ |
| 25208 | L4_MABX_B.DataTypeConversion2_g0 = L4_MABX_P.DataPage_Value; |
| 25209 | |
| 25210 | /* ArithShift: '<S931>/Shift_Arithmetic 2' */ |
| 25211 | L4_MABX_B.Shift_Arithmetic2_fh = L4_MABX_B.DataTypeConversion2_g0 << 24; |
| 25212 | |
| 25213 | /* DataTypeConversion: '<S931>/Data Type Conversion3' incorporates: |
| 25214 | * Constant: '<S931>/PDUFormat' |
| 25215 | */ |
| 25216 | L4_MABX_B.DataTypeConversion3_a = L4_MABX_P.PDUFormat_Value; |
| 25217 | |
| 25218 | /* ArithShift: '<S931>/Shift_Arithmetic 3' */ |
| 25219 | L4_MABX_B.Shift_Arithmetic3_ap = L4_MABX_B.DataTypeConversion3_a << 16; |
| 25220 | |
| 25221 | /* DataTypeConversion: '<S931>/Data Type Conversion4' incorporates: |
| 25222 | * Constant: '<S931>/PDUSpecific' |
| 25223 | */ |
| 25224 | L4_MABX_B.DataTypeConversion4_l = L4_MABX_P.PDUSpecific_Value; |
| 25225 | |
| 25226 | /* ArithShift: '<S931>/Shift_Arithmetic 4' */ |
| 25227 | L4_MABX_B.Shift_Arithmetic4_f = L4_MABX_B.DataTypeConversion4_l << 8; |
| 25228 | |
| 25229 | /* DataTypeConversion: '<S931>/Data Type Conversion5' incorporates: |
| 25230 | * Constant: '<S931>/SourceAddress' |
| 25231 | */ |
| 25232 | L4_MABX_B.DataTypeConversion5_d = L4_MABX_P.SourceAddress_Value; |
| 25233 | |
| 25234 | /* S-Function (sfix_bitop): '<S941>/Operator' */ |
| 25235 | L4_MABX_B.Operator_bi = L4_MABX_B.Shift_Arithmetic_jv | |
| 25236 | L4_MABX_B.Shift_Arithmetic1_g2 | L4_MABX_B.Shift_Arithmetic2_fh | |
| 25237 | L4_MABX_B.Shift_Arithmetic3_ap | L4_MABX_B.Shift_Arithmetic4_f | |
| 25238 | L4_MABX_B.DataTypeConversion5_d; |
| 25239 | |
| 25240 | /* DataTypeConversion: '<S941>/DataType' */ |
| 25241 | L4_MABX_B.DataType_jnf = L4_MABX_B.Operator_bi; |
| 25242 | |
| 25243 | /* DataTypeConversion: '<S930>/Data Type Conversion8' */ |
| 25244 | L4_MABX_B.DataTypeConversion8_hh = L4_MABX_B.DataType_jnf; |
| 25245 | |
| 25246 | /* S-Function (sfix_bitop): '<S937>/Operator' */ |
| 25247 | L4_MABX_B.Operator_au = L4_MABX_B.DataTypeConversion8_hh & |
| 25248 | L4_MABX_P.Operator_BitMask_ix; |
| 25249 | |
| 25250 | /* DataTypeConversion: '<S937>/DataType' */ |
| 25251 | tmp_0 = L4_MABX_B.Operator_au; |
| 25252 | if (tmp_0 > 255U) { |
| 25253 | tmp_0 = 255U; |
| 25254 | } |
| 25255 | |
| 25256 | L4_MABX_B.DataType_mp = (uint8_T)tmp_0; |
| 25257 | |
| 25258 | /* End of DataTypeConversion: '<S937>/DataType' */ |
| 25259 | |
| 25260 | /* S-Function (sfix_bitop): '<S938>/Operator' */ |
| 25261 | L4_MABX_B.Operator_p = L4_MABX_B.DataTypeConversion8_hh & |
| 25262 | L4_MABX_P.Operator_BitMask_l5; |
| 25263 | |
| 25264 | /* DataTypeConversion: '<S938>/DataType' */ |
| 25265 | tmp_0 = L4_MABX_B.Operator_p; |
| 25266 | if (tmp_0 > 65535U) { |
| 25267 | tmp_0 = 65535U; |
| 25268 | } |
| 25269 | |
| 25270 | L4_MABX_B.DataType_a2 = (uint16_T)tmp_0; |
| 25271 | |
| 25272 | /* End of DataTypeConversion: '<S938>/DataType' */ |
| 25273 | |
| 25274 | /* ArithShift: '<S930>/Shift_Arithmetic 3' */ |
| 25275 | L4_MABX_B.Shift_Arithmetic3_dh = (uint16_T)((uint32_T)L4_MABX_B.DataType_a2 >> |
| 25276 | 8); |
| 25277 | |
| 25278 | /* DataTypeConversion: '<S930>/Data Type Conversion9' */ |
| 25279 | tmp = L4_MABX_B.Shift_Arithmetic3_dh; |
| 25280 | if (tmp > 255) { |
| 25281 | tmp = 255U; |
| 25282 | } |
| 25283 | |
| 25284 | L4_MABX_B.MessageIDMidLowByte = (uint8_T)tmp; |
| 25285 | |
| 25286 | /* End of DataTypeConversion: '<S930>/Data Type Conversion9' */ |
| 25287 | |
| 25288 | /* S-Function (sfix_bitop): '<S939>/Operator' */ |
| 25289 | L4_MABX_B.Operator_k = L4_MABX_B.DataTypeConversion8_hh & |
| 25290 | L4_MABX_P.Operator_BitMask_ly; |
| 25291 | |
| 25292 | /* DataTypeConversion: '<S939>/DataType' */ |
| 25293 | L4_MABX_B.DataType_hl = L4_MABX_B.Operator_k; |
| 25294 | |
| 25295 | /* ArithShift: '<S930>/Shift_Arithmetic 4' */ |
| 25296 | L4_MABX_B.Shift_Arithmetic4_a = L4_MABX_B.DataType_hl >> 16; |
| 25297 | |
| 25298 | /* DataTypeConversion: '<S930>/Data Type Conversion10' */ |
| 25299 | tmp_0 = L4_MABX_B.Shift_Arithmetic4_a; |
| 25300 | if (tmp_0 > 255U) { |
| 25301 | tmp_0 = 255U; |
| 25302 | } |
| 25303 | |
| 25304 | L4_MABX_B.MessageIDMidHighByte = (uint8_T)tmp_0; |
| 25305 | |
| 25306 | /* End of DataTypeConversion: '<S930>/Data Type Conversion10' */ |
| 25307 | |
| 25308 | /* S-Function (sfix_bitop): '<S940>/Operator' */ |
| 25309 | L4_MABX_B.Operator_o = L4_MABX_B.DataTypeConversion8_hh & |
| 25310 | L4_MABX_P.Operator_BitMask_kq; |
| 25311 | |
| 25312 | /* DataTypeConversion: '<S940>/DataType' */ |
| 25313 | L4_MABX_B.DataType_bh = L4_MABX_B.Operator_o; |
| 25314 | |
| 25315 | /* ArithShift: '<S930>/Shift_Arithmetic 5' */ |
| 25316 | L4_MABX_B.Shift_Arithmetic5_d = L4_MABX_B.DataType_bh >> 24; |
| 25317 | |
| 25318 | /* DataTypeConversion: '<S930>/Data Type Conversion11' */ |
| 25319 | tmp_0 = L4_MABX_B.Shift_Arithmetic5_d; |
| 25320 | if (tmp_0 > 255U) { |
| 25321 | tmp_0 = 255U; |
| 25322 | } |
| 25323 | |
| 25324 | L4_MABX_B.MessageIDHighByte = (uint8_T)tmp_0; |
| 25325 | |
| 25326 | /* End of DataTypeConversion: '<S930>/Data Type Conversion11' */ |
| 25327 | |
| 25328 | /* DataTypeConversion: '<S930>/Data Type Conversion13' */ |
| 25329 | tmp_2 = L4_MABX_B.Unit_Delay; |
| 25330 | if (tmp_2 < 256.0) { |
| 25331 | if (tmp_2 >= 0.0) { |
| 25332 | tmp_1 = (uint8_T)tmp_2; |
| 25333 | } else { |
| 25334 | tmp_1 = 0U; |
| 25335 | } |
| 25336 | } else { |
| 25337 | tmp_1 = MAX_uint8_T; |
| 25338 | } |
| 25339 | |
| 25340 | L4_MABX_B.DataTypeConversion13_b = tmp_1; |
| 25341 | |
| 25342 | /* End of DataTypeConversion: '<S930>/Data Type Conversion13' */ |
| 25343 | |
| 25344 | /* S-Function (sfix_bitop): '<S936>/Operator' */ |
| 25345 | L4_MABX_B.Operator_mpq = (uint8_T)(L4_MABX_B.DataTypeConversion13_b & |
| 25346 | L4_MABX_P.Operator_BitMask_cq); |
| 25347 | |
| 25348 | /* DataTypeConversion: '<S936>/DataType' */ |
| 25349 | L4_MABX_B.DataType_dj = L4_MABX_B.Operator_mpq; |
| 25350 | |
| 25351 | /* Sum: '<S930>/Add' incorporates: |
| 25352 | * Constant: '<S892>/Constant3' |
| 25353 | */ |
| 25354 | L4_MABX_B.Checksum = (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T) |
| 25355 | ((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T) |
| 25356 | (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T) |
| 25357 | ((uint32_T)(uint8_T)((uint32_T)L4_MABX_B.DataType_ib + |
| 25358 | L4_MABX_P.Constant3_Value_b) + L4_MABX_P.Constant3_Value_b) + |
| 25359 | L4_MABX_P.Constant3_Value_b) + L4_MABX_P.Constant3_Value_b) + |
| 25360 | L4_MABX_P.Constant3_Value_b) + L4_MABX_P.Constant3_Value_b) + |
| 25361 | L4_MABX_B.DataType_mp) + L4_MABX_B.MessageIDMidLowByte) + |
| 25362 | L4_MABX_B.MessageIDMidHighByte) + L4_MABX_B.MessageIDHighByte) + |
| 25363 | L4_MABX_B.DataType_dj); |
| 25364 | |
| 25365 | /* ArithShift: '<S930>/Shift_Arithmetic 7' */ |
| 25366 | L4_MABX_B.Shift_Arithmetic7_b = (uint8_T)((uint32_T)L4_MABX_B.Checksum >> 4); |
| 25367 | |
| 25368 | /* Sum: '<S930>/Add1' */ |
| 25369 | L4_MABX_B.Add1_a = (uint8_T)((uint32_T)L4_MABX_B.Shift_Arithmetic7_b + |
| 25370 | L4_MABX_B.Checksum); |
| 25371 | |
| 25372 | /* S-Function (sfix_bitop): '<S935>/Operator' */ |
| 25373 | L4_MABX_B.Operator_ml = (uint8_T)(L4_MABX_B.Add1_a & |
| 25374 | L4_MABX_P.Operator_BitMask_fo); |
| 25375 | |
| 25376 | /* DataTypeConversion: '<S935>/DataType' */ |
| 25377 | L4_MABX_B.DataType_kw = L4_MABX_B.Operator_ml; |
| 25378 | |
| 25379 | /* DataTypeConversion: '<S892>/Data Type Conversion3' */ |
| 25380 | L4_MABX_B.DataTypeConversion3_ay = L4_MABX_B.DataType_kw; |
| 25381 | |
| 25382 | /* S-Function (sfix_bitop): '<S929>/Operator' */ |
| 25383 | L4_MABX_B.Operator_o1 = (uint8_T)(L4_MABX_B.DataTypeConversion3_ay & |
| 25384 | L4_MABX_P.Operator_BitMask_er); |
| 25385 | |
| 25386 | /* DataTypeConversion: '<S929>/DataType' */ |
| 25387 | L4_MABX_B.DataType_he = L4_MABX_B.Operator_o1; |
| 25388 | |
| 25389 | /* ArithShift: '<S892>/Shift_Arithmetic 3' */ |
| 25390 | L4_MABX_B.Shift_Arithmetic3_hx = (uint8_T)(L4_MABX_B.DataType_he << 4); |
| 25391 | |
| 25392 | /* S-Function (sfix_bitop): '<S933>/Operator' */ |
| 25393 | L4_MABX_B.Operator_cq = (uint8_T)(L4_MABX_B.DataType_hu | |
| 25394 | L4_MABX_B.Shift_Arithmetic3_hx); |
| 25395 | |
| 25396 | /* DataTypeConversion: '<S933>/DataType' */ |
| 25397 | L4_MABX_B.DataType_ff = L4_MABX_B.Operator_cq; |
| 25398 | |
| 25399 | /* DataTypeConversion: '<S887>/Data Type Conversion1' incorporates: |
| 25400 | * Constant: '<S892>/Constant3' |
| 25401 | */ |
| 25402 | L4_MABX_B.DataTypeConversion1_hv[0] = L4_MABX_B.DataType_ib; |
| 25403 | L4_MABX_B.DataTypeConversion1_hv[1] = L4_MABX_P.Constant3_Value_b; |
| 25404 | L4_MABX_B.DataTypeConversion1_hv[2] = L4_MABX_P.Constant3_Value_b; |
| 25405 | L4_MABX_B.DataTypeConversion1_hv[3] = L4_MABX_P.Constant3_Value_b; |
| 25406 | L4_MABX_B.DataTypeConversion1_hv[4] = L4_MABX_P.Constant3_Value_b; |
| 25407 | L4_MABX_B.DataTypeConversion1_hv[5] = L4_MABX_P.Constant3_Value_b; |
| 25408 | L4_MABX_B.DataTypeConversion1_hv[6] = L4_MABX_P.Constant3_Value_b; |
| 25409 | L4_MABX_B.DataTypeConversion1_hv[7] = L4_MABX_B.DataType_ff; |
| 25410 | |
| 25411 | /* DataTypeConversion: '<S887>/Data Type Conversion' incorporates: |
| 25412 | * Constant: '<S859>/CANT_PROPB_XPR_FC_CHANNEL_APV' |
| 25413 | */ |
| 25414 | L4_MABX_B.DataTypeConversion_ln = (uint8_T) |
| 25415 | L4_MABX_P.CANT_PROPB_XPR_FC_CHANNEL_APV_V; |
| 25416 | |
| 25417 | /* S-Function (sfix_bitop): '<S902>/Operator' */ |
| 25418 | L4_MABX_B.Operator_im = (uint8_T)(L4_MABX_B.DataTypeConversion_ln & |
| 25419 | L4_MABX_P.Operator_BitMask_ci); |
| 25420 | |
| 25421 | /* DataTypeConversion: '<S902>/DataType' */ |
| 25422 | L4_MABX_B.DataType_cp = L4_MABX_B.Operator_im; |
| 25423 | |
| 25424 | /* DataTypeConversion: '<S887>/Data Type Conversion2' */ |
| 25425 | L4_MABX_B.DataTypeConversion2_f1 = (L4_MABX_B.DataType_cp != 0); |
| 25426 | |
| 25427 | /* Logic: '<S910>/Operator' */ |
| 25428 | L4_MABX_B.Operator_jh = (L4_MABX_B.TmpRTBAtOperatorInport1 && |
| 25429 | L4_MABX_B.DataTypeConversion2_f1); |
| 25430 | |
| 25431 | /* DataTypeConversion: '<S910>/DataType' */ |
| 25432 | L4_MABX_B.DataType_pk = L4_MABX_B.Operator_jh; |
| 25433 | |
| 25434 | /* Outputs for Enabled SubSystem: '<S914>/PropB_XPR_FC' incorporates: |
| 25435 | * EnablePort: '<S916>/Enable' |
| 25436 | */ |
| 25437 | if (L4_MABX_B.DataType_pk) { |
| 25438 | /* S-Function (rti_commonblock): '<S916>/S-Function1' */ |
| 25439 | /* This comment workarounds a code generation problem */ |
| 25440 | |
| 25441 | /* dSPACE RTICAN TX Message Block: "PropB_XPR_FC" Id:419366140 */ |
| 25442 | { |
| 25443 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 25444 | |
| 25445 | Float32 delayTime = 0.0; |
| 25446 | |
| 25447 | /* ... Read status and timestamp info (previous message) */ |
| 25448 | can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]); |
| 25449 | |
| 25450 | /* Convert timestamp */ |
| 25451 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->processed) { |
| 25452 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->timestamp = |
| 25453 | rtk_dsts_time_to_simtime_convert |
| 25454 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->timestamp); |
| 25455 | } |
| 25456 | |
| 25457 | /* Messages with timestamp zero have been received in pause/stop state |
| 25458 | and must not be handled. |
| 25459 | */ |
| 25460 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->timestamp > 0.0) { |
| 25461 | L4_MABX_B.SFunction1_o1_n = (real_T) |
| 25462 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->processed; |
| 25463 | L4_MABX_B.SFunction1_o2_du = (real_T) |
| 25464 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->timestamp; |
| 25465 | L4_MABX_B.SFunction1_o3_b1 = (real_T) |
| 25466 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->deltatime; |
| 25467 | L4_MABX_B.SFunction1_o4_o = (real_T) |
| 25468 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->delaytime; |
| 25469 | } |
| 25470 | |
| 25471 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 25472 | { |
| 25473 | rtican_Signal_t CAN_Sgn; |
| 25474 | |
| 25475 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 25476 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25477 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_hv[0] ) |
| 25478 | + 0.5); |
| 25479 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25480 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25481 | |
| 25482 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 25483 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25484 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_hv[1] ) |
| 25485 | + 0.5); |
| 25486 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25487 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 25488 | |
| 25489 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 25490 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25491 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_hv[2] ) |
| 25492 | + 0.5); |
| 25493 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25494 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 25495 | |
| 25496 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 25497 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25498 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_hv[3] ) |
| 25499 | + 0.5); |
| 25500 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25501 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 25502 | |
| 25503 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 25504 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25505 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_hv[4] ) |
| 25506 | + 0.5); |
| 25507 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25508 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25509 | |
| 25510 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 25511 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25512 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_hv[5] ) |
| 25513 | + 0.5); |
| 25514 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25515 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 25516 | |
| 25517 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 25518 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25519 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_hv[6] ) |
| 25520 | + 0.5); |
| 25521 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25522 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 25523 | |
| 25524 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 25525 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25526 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_hv[7] ) |
| 25527 | + 0.5); |
| 25528 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25529 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 25530 | } |
| 25531 | |
| 25532 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 25533 | can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC], 8, |
| 25534 | &(CAN_Msg[0]), delayTime); |
| 25535 | } |
| 25536 | } |
| 25537 | |
| 25538 | /* End of Outputs for SubSystem: '<S914>/PropB_XPR_FC' */ |
| 25539 | |
| 25540 | /* S-Function (sfix_bitop): '<S907>/Operator' */ |
| 25541 | L4_MABX_B.Operator_jz = (uint8_T)(L4_MABX_B.DataTypeConversion_ln & |
| 25542 | L4_MABX_P.Operator_BitMask_p); |
| 25543 | |
| 25544 | /* DataTypeConversion: '<S907>/DataType' */ |
| 25545 | L4_MABX_B.DataType_pm = L4_MABX_B.Operator_jz; |
| 25546 | |
| 25547 | /* ArithShift: '<S887>/Shift_Arithmetic 2' */ |
| 25548 | L4_MABX_B.Shift_Arithmetic2_f = ldexp(L4_MABX_B.DataType_pm, (-3)); |
| 25549 | |
| 25550 | /* DataTypeConversion: '<S887>/Data Type Conversion5' */ |
| 25551 | L4_MABX_B.DataTypeConversion5_kt = (L4_MABX_B.Shift_Arithmetic2_f != 0.0); |
| 25552 | |
| 25553 | /* Logic: '<S913>/Operator' */ |
| 25554 | L4_MABX_B.Operator_iqn = (L4_MABX_B.TmpRTBAtOperatorInport1_c && |
| 25555 | L4_MABX_B.DataTypeConversion5_kt); |
| 25556 | |
| 25557 | /* DataTypeConversion: '<S913>/DataType' */ |
| 25558 | L4_MABX_B.DataType_pf = L4_MABX_B.Operator_iqn; |
| 25559 | |
| 25560 | /* Outputs for Enabled SubSystem: '<S915>/PropB_XPR_FC' incorporates: |
| 25561 | * EnablePort: '<S917>/Enable' |
| 25562 | */ |
| 25563 | if (L4_MABX_B.DataType_pf) { |
| 25564 | /* S-Function (rti_commonblock): '<S917>/S-Function1' */ |
| 25565 | /* This comment workarounds a code generation problem */ |
| 25566 | |
| 25567 | /* dSPACE RTICAN TX Message Block: "PropB_XPR_FC" Id:419366140 */ |
| 25568 | { |
| 25569 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 25570 | |
| 25571 | Float32 delayTime = 0.0; |
| 25572 | |
| 25573 | /* ... Read status and timestamp info (previous message) */ |
| 25574 | can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]); |
| 25575 | |
| 25576 | /* Convert timestamp */ |
| 25577 | if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->processed) { |
| 25578 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->timestamp = |
| 25579 | rtk_dsts_time_to_simtime_convert |
| 25580 | (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->timestamp); |
| 25581 | } |
| 25582 | |
| 25583 | /* Messages with timestamp zero have been received in pause/stop state |
| 25584 | and must not be handled. |
| 25585 | */ |
| 25586 | if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->timestamp > 0.0) { |
| 25587 | L4_MABX_B.SFunction1_o1_fy = (real_T) |
| 25588 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->processed; |
| 25589 | L4_MABX_B.SFunction1_o2_l = (real_T) |
| 25590 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->timestamp; |
| 25591 | L4_MABX_B.SFunction1_o3_f0 = (real_T) |
| 25592 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->deltatime; |
| 25593 | L4_MABX_B.SFunction1_o4_p = (real_T) |
| 25594 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->delaytime; |
| 25595 | } |
| 25596 | |
| 25597 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 25598 | { |
| 25599 | rtican_Signal_t CAN_Sgn; |
| 25600 | |
| 25601 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 25602 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25603 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_hv[0] ) |
| 25604 | + 0.5); |
| 25605 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25606 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25607 | |
| 25608 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 25609 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25610 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_hv[1] ) |
| 25611 | + 0.5); |
| 25612 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25613 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 25614 | |
| 25615 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 25616 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25617 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_hv[2] ) |
| 25618 | + 0.5); |
| 25619 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25620 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 25621 | |
| 25622 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 25623 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25624 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_hv[3] ) |
| 25625 | + 0.5); |
| 25626 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25627 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 25628 | |
| 25629 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 25630 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25631 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_hv[4] ) |
| 25632 | + 0.5); |
| 25633 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25634 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25635 | |
| 25636 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 25637 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25638 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_hv[5] ) |
| 25639 | + 0.5); |
| 25640 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25641 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 25642 | |
| 25643 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 25644 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25645 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_hv[6] ) |
| 25646 | + 0.5); |
| 25647 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25648 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 25649 | |
| 25650 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 25651 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25652 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_hv[7] ) |
| 25653 | + 0.5); |
| 25654 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25655 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 25656 | } |
| 25657 | |
| 25658 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 25659 | can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC], 8, |
| 25660 | &(CAN_Msg[0]), delayTime); |
| 25661 | } |
| 25662 | } |
| 25663 | |
| 25664 | /* End of Outputs for SubSystem: '<S915>/PropB_XPR_FC' */ |
| 25665 | |
| 25666 | /* S-Function (sfix_bitop): '<S903>/Operator' */ |
| 25667 | L4_MABX_B.Operator_fn = (uint8_T)(L4_MABX_B.DataTypeConversion_ln & |
| 25668 | L4_MABX_P.Operator_BitMask_i); |
| 25669 | |
| 25670 | /* DataTypeConversion: '<S903>/DataType' */ |
| 25671 | L4_MABX_B.DataType_e2 = L4_MABX_B.Operator_fn; |
| 25672 | |
| 25673 | /* S-Function (sfix_bitop): '<S908>/Operator' */ |
| 25674 | L4_MABX_B.Operator_bs = (uint8_T)(L4_MABX_B.DataTypeConversion_ln & |
| 25675 | L4_MABX_P.Operator_BitMask_gt); |
| 25676 | |
| 25677 | /* DataTypeConversion: '<S908>/DataType' */ |
| 25678 | L4_MABX_B.DataType_n = L4_MABX_B.Operator_bs; |
| 25679 | |
| 25680 | /* ArithShift: '<S887>/Shift_Arithmetic 3' */ |
| 25681 | L4_MABX_B.Shift_Arithmetic3_a = ldexp(L4_MABX_B.DataType_n, (-4)); |
| 25682 | |
| 25683 | /* DataTypeConversion: '<S887>/Data Type Conversion6' */ |
| 25684 | L4_MABX_B.DataTypeConversion6_py = (L4_MABX_B.Shift_Arithmetic3_a != 0.0); |
| 25685 | |
| 25686 | /* Logic: '<S904>/Operator' */ |
| 25687 | L4_MABX_B.Operator_ary = (L4_MABX_B.TmpRTBAtOperatorInport1_n && |
| 25688 | L4_MABX_B.DataTypeConversion6_py); |
| 25689 | |
| 25690 | /* DataTypeConversion: '<S904>/DataType' */ |
| 25691 | L4_MABX_B.DataType_ewo = L4_MABX_B.Operator_ary; |
| 25692 | |
| 25693 | /* S-Function (sfix_bitop): '<S909>/Operator' */ |
| 25694 | L4_MABX_B.Operator_cu = (uint8_T)(L4_MABX_B.DataTypeConversion_ln & |
| 25695 | L4_MABX_P.Operator_BitMask_hb); |
| 25696 | |
| 25697 | /* DataTypeConversion: '<S909>/DataType' */ |
| 25698 | L4_MABX_B.DataType_k = L4_MABX_B.Operator_cu; |
| 25699 | |
| 25700 | /* ArithShift: '<S887>/Shift_Arithmetic 4' */ |
| 25701 | L4_MABX_B.Shift_Arithmetic4_i = ldexp(L4_MABX_B.DataType_k, (-5)); |
| 25702 | |
| 25703 | /* DataTypeConversion: '<S887>/Data Type Conversion7' */ |
| 25704 | L4_MABX_B.DataTypeConversion7_mh = (L4_MABX_B.Shift_Arithmetic4_i != 0.0); |
| 25705 | |
| 25706 | /* Logic: '<S905>/Operator' */ |
| 25707 | L4_MABX_B.Operator_jg = (L4_MABX_B.TmpRTBAtOperatorInport1_k && |
| 25708 | L4_MABX_B.DataTypeConversion7_mh); |
| 25709 | |
| 25710 | /* DataTypeConversion: '<S905>/DataType' */ |
| 25711 | L4_MABX_B.DataType_elw = L4_MABX_B.Operator_jg; |
| 25712 | |
| 25713 | /* S-Function (sfix_bitop): '<S906>/Operator' */ |
| 25714 | L4_MABX_B.Operator_l3 = (uint8_T)(L4_MABX_B.DataTypeConversion_ln & |
| 25715 | L4_MABX_P.Operator_BitMask_pp); |
| 25716 | |
| 25717 | /* DataTypeConversion: '<S906>/DataType' */ |
| 25718 | L4_MABX_B.DataType_c = L4_MABX_B.Operator_l3; |
| 25719 | |
| 25720 | /* ArithShift: '<S887>/Shift_Arithmetic ' */ |
| 25721 | L4_MABX_B.Shift_Arithmetic_c = ldexp(L4_MABX_B.DataType_e2, (-1)); |
| 25722 | |
| 25723 | /* DataTypeConversion: '<S887>/Data Type Conversion3' */ |
| 25724 | L4_MABX_B.DataTypeConversion3_be = (L4_MABX_B.Shift_Arithmetic_c != 0.0); |
| 25725 | |
| 25726 | /* Logic: '<S911>/Operator' */ |
| 25727 | L4_MABX_B.Operator_cc = (L4_MABX_B.TmpRTBAtOperatorInport1_kn && |
| 25728 | L4_MABX_B.DataTypeConversion3_be); |
| 25729 | |
| 25730 | /* DataTypeConversion: '<S911>/DataType' */ |
| 25731 | L4_MABX_B.DataType_h1s = L4_MABX_B.Operator_cc; |
| 25732 | |
| 25733 | /* ArithShift: '<S887>/Shift_Arithmetic 1' */ |
| 25734 | L4_MABX_B.Shift_Arithmetic1_j = ldexp(L4_MABX_B.DataType_c, (-2)); |
| 25735 | |
| 25736 | /* DataTypeConversion: '<S887>/Data Type Conversion4' */ |
| 25737 | L4_MABX_B.DataTypeConversion4_d1 = (L4_MABX_B.Shift_Arithmetic1_j != 0.0); |
| 25738 | |
| 25739 | /* Logic: '<S912>/Operator' */ |
| 25740 | L4_MABX_B.Operator_btn = (L4_MABX_B.TmpRTBAtOperatorInport1_cw && |
| 25741 | L4_MABX_B.DataTypeConversion4_d1); |
| 25742 | |
| 25743 | /* DataTypeConversion: '<S912>/DataType' */ |
| 25744 | L4_MABX_B.DataType_gsm = L4_MABX_B.Operator_btn; |
| 25745 | |
| 25746 | /* DataTypeConversion: '<S944>/Data Type Conversion' */ |
| 25747 | L4_MABX_B.DataTypeConversion_p = L4_MABX_B.Latitude__m; |
| 25748 | |
| 25749 | /* DataTypeConversion: '<S944>/Data Type Conversion1' */ |
| 25750 | L4_MABX_B.DataTypeConversion1_he = L4_MABX_B.Longitude__a; |
| 25751 | |
| 25752 | /* DataTypeConversion: '<S893>/Data Type Conversion2' incorporates: |
| 25753 | * Constant: '<S859>/enablePosRapidUpdateTX' |
| 25754 | */ |
| 25755 | L4_MABX_B.DataTypeConversion2_c4 = L4_MABX_P.enablePosRapidUpdateTX_Value; |
| 25756 | |
| 25757 | /* Outputs for Enabled SubSystem: '<S944>/Std_PosRapidUpdate_01' incorporates: |
| 25758 | * EnablePort: '<S945>/Enable' |
| 25759 | */ |
| 25760 | if (L4_MABX_B.DataTypeConversion2_c4) { |
| 25761 | /* S-Function (rti_commonblock): '<S945>/S-Function1' */ |
| 25762 | /* This comment workarounds a code generation problem */ |
| 25763 | |
| 25764 | /* dSPACE RTICAN TX Message Block: "Std_PosRapidUpdate_01" Id:3 */ |
| 25765 | { |
| 25766 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 25767 | |
| 25768 | Float32 delayTime = 0.0; |
| 25769 | |
| 25770 | /* ... Read status and timestamp info (previous message) */ |
| 25771 | can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]); |
| 25772 | |
| 25773 | /* Convert timestamp */ |
| 25774 | if (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->processed) { |
| 25775 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->timestamp = |
| 25776 | rtk_dsts_time_to_simtime_convert |
| 25777 | (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->timestamp); |
| 25778 | } |
| 25779 | |
| 25780 | /* Messages with timestamp zero have been received in pause/stop state |
| 25781 | and must not be handled. |
| 25782 | */ |
| 25783 | if (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->timestamp > 0.0) { |
| 25784 | L4_MABX_B.SFunction1_o1_lh = (real_T) |
| 25785 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->processed; |
| 25786 | L4_MABX_B.SFunction1_o2_b0 = (real_T) |
| 25787 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->timestamp; |
| 25788 | L4_MABX_B.SFunction1_o3_bz = (real_T) |
| 25789 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->deltatime; |
| 25790 | L4_MABX_B.SFunction1_o4_n3 = (real_T) |
| 25791 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->delaytime; |
| 25792 | } |
| 25793 | |
| 25794 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 25795 | { |
| 25796 | rtican_Signal_t CAN_Sgn; |
| 25797 | |
| 25798 | /* ...... "Latitude_" (0|32, standard signal, signed int, little endian) */ |
| 25799 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25800 | if (( L4_MABX_B.DataTypeConversion_p - ( 0 ) ) / 1.0E-7 < -0.5) |
| 25801 | CAN_Sgn.SignedSgn = (Int32) (( L4_MABX_B.DataTypeConversion_p - ( 0 ) ) |
| 25802 | / 1.0E-7 - 0.5); |
| 25803 | else |
| 25804 | CAN_Sgn.SignedSgn = (Int32) (( L4_MABX_B.DataTypeConversion_p - ( 0 ) ) |
| 25805 | / 1.0E-7 + 0.5); |
| 25806 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25807 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte1; |
| 25808 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte2; |
| 25809 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte3; |
| 25810 | |
| 25811 | /* ...... "Longitude_" (32|32, standard signal, signed int, little endian) */ |
| 25812 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25813 | if (( L4_MABX_B.DataTypeConversion1_he - ( 0 ) ) / 1.0E-7 < -0.5) |
| 25814 | CAN_Sgn.SignedSgn = (Int32) (( L4_MABX_B.DataTypeConversion1_he - ( 0 ) |
| 25815 | ) / 1.0E-7 - 0.5); |
| 25816 | else |
| 25817 | CAN_Sgn.SignedSgn = (Int32) (( L4_MABX_B.DataTypeConversion1_he - ( 0 ) |
| 25818 | ) / 1.0E-7 + 0.5); |
| 25819 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25820 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte1; |
| 25821 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte2; |
| 25822 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte3; |
| 25823 | } |
| 25824 | |
| 25825 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 25826 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3], 8, &(CAN_Msg[0]), |
| 25827 | delayTime); |
| 25828 | } |
| 25829 | } |
| 25830 | |
| 25831 | /* End of Outputs for SubSystem: '<S944>/Std_PosRapidUpdate_01' */ |
| 25832 | |
| 25833 | /* Outputs for Enabled SubSystem: '<S895>/CCVS1_00' incorporates: |
| 25834 | * EnablePort: '<S897>/Enable' |
| 25835 | */ |
| 25836 | /* Outputs for Enabled SubSystem: '<S894>/CCVS1_00' incorporates: |
| 25837 | * EnablePort: '<S896>/Enable' |
| 25838 | */ |
| 25839 | /* Constant: '<S885>/Enable_TX_CCVS1_00' */ |
| 25840 | if (L4_MABX_P.Enable_TX_CCVS1_00_Value) { |
| 25841 | /* S-Function (rti_commonblock): '<S896>/S-Function1' */ |
| 25842 | /* This comment workarounds a code generation problem */ |
| 25843 | |
| 25844 | /* dSPACE RTICAN TX Message Block: "CCVS1_00" Id:419361024 */ |
| 25845 | { |
| 25846 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 25847 | |
| 25848 | Float32 delayTime = 0.0; |
| 25849 | |
| 25850 | /* ... Read status and timestamp info (previous message) */ |
| 25851 | can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]); |
| 25852 | |
| 25853 | /* Convert timestamp */ |
| 25854 | if (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->processed) { |
| 25855 | can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->timestamp = |
| 25856 | rtk_dsts_time_to_simtime_convert |
| 25857 | (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->timestamp); |
| 25858 | } |
| 25859 | |
| 25860 | /* Messages with timestamp zero have been received in pause/stop state |
| 25861 | and must not be handled. |
| 25862 | */ |
| 25863 | if (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->timestamp > 0.0) { |
| 25864 | L4_MABX_B.SFunction1_o1_c = (real_T) |
| 25865 | can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->processed; |
| 25866 | L4_MABX_B.SFunction1_o2_oc = (real_T) |
| 25867 | can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->timestamp; |
| 25868 | L4_MABX_B.SFunction1_o3_h = (real_T) |
| 25869 | can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->deltatime; |
| 25870 | L4_MABX_B.SFunction1_o4_hr = (real_T) |
| 25871 | can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->delaytime; |
| 25872 | } |
| 25873 | |
| 25874 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 25875 | { |
| 25876 | rtican_Signal_t CAN_Sgn; |
| 25877 | |
| 25878 | /* ...... "TwoSpeedAxleSwitch" (0|2, standard signal, unsigned int, little endian) */ |
| 25879 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25880 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.TwoSpeedAxleSwitch_a ) + 0.5); |
| 25881 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25882 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25883 | |
| 25884 | /* ...... "ParkingBrakeSwitch" (2|2, standard signal, unsigned int, little endian) */ |
| 25885 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25886 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkingBrakeSwitch_m ) + 0.5); |
| 25887 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25888 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 25889 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25890 | |
| 25891 | /* ...... "CruiseCtrlPauseSwitch" (4|2, standard signal, unsigned int, little endian) */ |
| 25892 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25893 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlPauseSwitch_e ) + |
| 25894 | 0.5); |
| 25895 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25896 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 25897 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25898 | |
| 25899 | /* ...... "ParkBrakeReleaseInhibitRq" (6|2, standard signal, unsigned int, little endian) */ |
| 25900 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25901 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkBrakeReleaseInhibitRq_n ) |
| 25902 | + 0.5); |
| 25903 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25904 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 25905 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25906 | |
| 25907 | /* ...... "WheelBasedVehicleSpeed" (8|16, standard signal, unsigned int, little endian) */ |
| 25908 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25909 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.WheelBasedVehicleSpeed_pj - |
| 25910 | ( 0 ) ) / 0.00390625 + 0.5); |
| 25911 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 25912 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 25913 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte1; |
| 25914 | |
| 25915 | /* ...... "CruiseCtrlActive" (24|2, standard signal, unsigned int, little endian) */ |
| 25916 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25917 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlActive_i ) + 0.5); |
| 25918 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25919 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 25920 | |
| 25921 | /* ...... "CruiseCtrlEnableSwitch" (26|2, standard signal, unsigned int, little endian) */ |
| 25922 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25923 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlEnableSwitch_n3 ) |
| 25924 | + 0.5); |
| 25925 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25926 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 25927 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 25928 | |
| 25929 | /* ...... "BrakeSwitch" (28|2, standard signal, unsigned int, little endian) */ |
| 25930 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25931 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.BrakeSwitch_n4 ) + 0.5); |
| 25932 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25933 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 25934 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 25935 | |
| 25936 | /* ...... "ClutchSwitch" (30|2, standard signal, unsigned int, little endian) */ |
| 25937 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25938 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ClutchSwitch_l ) + 0.5); |
| 25939 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25940 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 25941 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 25942 | |
| 25943 | /* ...... "CruiseCtrlSetSwitch" (32|2, standard signal, unsigned int, little endian) */ |
| 25944 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25945 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSwitch_h ) + |
| 25946 | 0.5); |
| 25947 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25948 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25949 | |
| 25950 | /* ...... "CruiseCtrlCoastSwitch" (34|2, standard signal, unsigned int, little endian) */ |
| 25951 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25952 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlCoastSwitch_c ) + |
| 25953 | 0.5); |
| 25954 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25955 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 25956 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25957 | |
| 25958 | /* ...... "CruiseCtrlResumeSwitch" (36|2, standard signal, unsigned int, little endian) */ |
| 25959 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25960 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlResumeSwitch_b ) + |
| 25961 | 0.5); |
| 25962 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25963 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 25964 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25965 | |
| 25966 | /* ...... "CruiseCtrlAccelerateSwitch" (38|2, standard signal, unsigned int, little endian) */ |
| 25967 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25968 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlAccelerateSwitch_c |
| 25969 | ) + 0.5); |
| 25970 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25971 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 25972 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25973 | |
| 25974 | /* ...... "CruiseCtrlSetSpeed" (40|8, standard signal, unsigned int, little endian) */ |
| 25975 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25976 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSpeed_m ) + 0.5); |
| 25977 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25978 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 25979 | |
| 25980 | /* ...... "PTOGovernorState" (48|5, standard signal, unsigned int, little endian) */ |
| 25981 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25982 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.PTOGovernorState_c ) + 0.5); |
| 25983 | CAN_Sgn.UnsignedSgn &= 0x0000001F; |
| 25984 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 25985 | |
| 25986 | /* ...... "CruiseCtrlStates" (53|3, standard signal, unsigned int, little endian) */ |
| 25987 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25988 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlStates_k ) + 0.5); |
| 25989 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 25990 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 5; |
| 25991 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 25992 | |
| 25993 | /* ...... "EngIdleIncrementSwitch" (56|2, standard signal, unsigned int, little endian) */ |
| 25994 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25995 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleIncrementSwitch_f ) + |
| 25996 | 0.5); |
| 25997 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25998 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 25999 | |
| 26000 | /* ...... "EngIdleDecrementSwitch" (58|2, standard signal, unsigned int, little endian) */ |
| 26001 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26002 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleDecrementSwitch_i ) + |
| 26003 | 0.5); |
| 26004 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26005 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 26006 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 26007 | |
| 26008 | /* ...... "EngTestModeSwitch" (60|2, standard signal, unsigned int, little endian) */ |
| 26009 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26010 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngTestModeSwitch_d ) + 0.5); |
| 26011 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26012 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 26013 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 26014 | |
| 26015 | /* ...... "EngShutdownOverrideSwitch" (62|2, standard signal, unsigned int, little endian) */ |
| 26016 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26017 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngShutdownOverrideSwitch_p ) |
| 26018 | + 0.5); |
| 26019 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26020 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 26021 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 26022 | } |
| 26023 | |
| 26024 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 26025 | can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100], 8, |
| 26026 | &(CAN_Msg[0]), delayTime); |
| 26027 | } |
| 26028 | |
| 26029 | /* S-Function (rti_commonblock): '<S897>/S-Function1' */ |
| 26030 | /* This comment workarounds a code generation problem */ |
| 26031 | |
| 26032 | /* dSPACE RTICAN TX Message Block: "CCVS1_00" Id:218034432 */ |
| 26033 | { |
| 26034 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 26035 | |
| 26036 | Float32 delayTime = 0.0; |
| 26037 | |
| 26038 | /* ... Read status and timestamp info (previous message) */ |
| 26039 | can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]); |
| 26040 | |
| 26041 | /* Convert timestamp */ |
| 26042 | if (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->processed) { |
| 26043 | can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->timestamp = |
| 26044 | rtk_dsts_time_to_simtime_convert |
| 26045 | (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->timestamp); |
| 26046 | } |
| 26047 | |
| 26048 | /* Messages with timestamp zero have been received in pause/stop state |
| 26049 | and must not be handled. |
| 26050 | */ |
| 26051 | if (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->timestamp > 0.0) { |
| 26052 | L4_MABX_B.SFunction1_o1_i = (real_T) |
| 26053 | can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->processed; |
| 26054 | L4_MABX_B.SFunction1_o2_gv = (real_T) |
| 26055 | can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->timestamp; |
| 26056 | L4_MABX_B.SFunction1_o3_j = (real_T) |
| 26057 | can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->deltatime; |
| 26058 | L4_MABX_B.SFunction1_o4_fm = (real_T) |
| 26059 | can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->delaytime; |
| 26060 | } |
| 26061 | |
| 26062 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 26063 | { |
| 26064 | rtican_Signal_t CAN_Sgn; |
| 26065 | |
| 26066 | /* ...... "TwoSpeedAxleSwitch" (0|2, standard signal, unsigned int, little endian) */ |
| 26067 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26068 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.TwoSpeedAxleSwitch_ay ) + |
| 26069 | 0.5); |
| 26070 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26071 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26072 | |
| 26073 | /* ...... "ParkingBrakeSwitch" (2|2, standard signal, unsigned int, little endian) */ |
| 26074 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26075 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkingBrakeSwitch_md ) + |
| 26076 | 0.5); |
| 26077 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26078 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 26079 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26080 | |
| 26081 | /* ...... "CruiseCtrlPauseSwitch" (4|2, standard signal, unsigned int, little endian) */ |
| 26082 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26083 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlPauseSwitch_eq ) + |
| 26084 | 0.5); |
| 26085 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26086 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 26087 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26088 | |
| 26089 | /* ...... "ParkBrakeReleaseInhibitRq" (6|2, standard signal, unsigned int, little endian) */ |
| 26090 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26091 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkBrakeReleaseInhibitRq_n0 |
| 26092 | ) + 0.5); |
| 26093 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26094 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 26095 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26096 | |
| 26097 | /* ...... "WheelBasedVehicleSpeed" (8|16, standard signal, unsigned int, little endian) */ |
| 26098 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26099 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.WheelBasedVehicleSpeed_pjm - |
| 26100 | ( 0 ) ) / 0.00390625 + 0.5); |
| 26101 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 26102 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 26103 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte1; |
| 26104 | |
| 26105 | /* ...... "CruiseCtrlActive" (24|2, standard signal, unsigned int, little endian) */ |
| 26106 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26107 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlActive_iq ) + 0.5); |
| 26108 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26109 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 26110 | |
| 26111 | /* ...... "CruiseCtrlEnableSwitch" (26|2, standard signal, unsigned int, little endian) */ |
| 26112 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26113 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlEnableSwitch_n3b ) |
| 26114 | + 0.5); |
| 26115 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26116 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 26117 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 26118 | |
| 26119 | /* ...... "BrakeSwitch" (28|2, standard signal, unsigned int, little endian) */ |
| 26120 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26121 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.BrakeSwitch_n4h ) + 0.5); |
| 26122 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26123 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 26124 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 26125 | |
| 26126 | /* ...... "ClutchSwitch" (30|2, standard signal, unsigned int, little endian) */ |
| 26127 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26128 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ClutchSwitch_lp ) + 0.5); |
| 26129 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26130 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 26131 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 26132 | |
| 26133 | /* ...... "CruiseCtrlSetSwitch" (32|2, standard signal, unsigned int, little endian) */ |
| 26134 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26135 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSwitch_hj ) + |
| 26136 | 0.5); |
| 26137 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26138 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 26139 | |
| 26140 | /* ...... "CruiseCtrlCoastSwitch" (34|2, standard signal, unsigned int, little endian) */ |
| 26141 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26142 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlCoastSwitch_cs ) + |
| 26143 | 0.5); |
| 26144 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26145 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 26146 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 26147 | |
| 26148 | /* ...... "CruiseCtrlResumeSwitch" (36|2, standard signal, unsigned int, little endian) */ |
| 26149 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26150 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlResumeSwitch_b4 ) |
| 26151 | + 0.5); |
| 26152 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26153 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 26154 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 26155 | |
| 26156 | /* ...... "CruiseCtrlAccelerateSwitch" (38|2, standard signal, unsigned int, little endian) */ |
| 26157 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26158 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 26159 | (( L4_MABX_B.CruiseCtrlAccelerateSwitch_ci ) + 0.5); |
| 26160 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26161 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 26162 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 26163 | |
| 26164 | /* ...... "CruiseCtrlSetSpeed" (40|8, standard signal, unsigned int, little endian) */ |
| 26165 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26166 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSpeed_mm ) + |
| 26167 | 0.5); |
| 26168 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26169 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 26170 | |
| 26171 | /* ...... "PTOGovernorState" (48|5, standard signal, unsigned int, little endian) */ |
| 26172 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26173 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.PTOGovernorState_cv ) + 0.5); |
| 26174 | CAN_Sgn.UnsignedSgn &= 0x0000001F; |
| 26175 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 26176 | |
| 26177 | /* ...... "CruiseCtrlStates" (53|3, standard signal, unsigned int, little endian) */ |
| 26178 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26179 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlStates_ks ) + 0.5); |
| 26180 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 26181 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 5; |
| 26182 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 26183 | |
| 26184 | /* ...... "EngIdleIncrementSwitch" (56|2, standard signal, unsigned int, little endian) */ |
| 26185 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26186 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleIncrementSwitch_f1 ) |
| 26187 | + 0.5); |
| 26188 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26189 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 26190 | |
| 26191 | /* ...... "EngIdleDecrementSwitch" (58|2, standard signal, unsigned int, little endian) */ |
| 26192 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26193 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleDecrementSwitch_il ) |
| 26194 | + 0.5); |
| 26195 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26196 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 26197 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 26198 | |
| 26199 | /* ...... "EngTestModeSwitch" (60|2, standard signal, unsigned int, little endian) */ |
| 26200 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26201 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngTestModeSwitch_d0 ) + 0.5); |
| 26202 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26203 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 26204 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 26205 | |
| 26206 | /* ...... "EngShutdownOverrideSwitch" (62|2, standard signal, unsigned int, little endian) */ |
| 26207 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26208 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngShutdownOverrideSwitch_pi |
| 26209 | ) + 0.5); |
| 26210 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26211 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 26212 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 26213 | } |
| 26214 | |
| 26215 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 26216 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100], 8, |
| 26217 | &(CAN_Msg[0]), delayTime); |
| 26218 | } |
| 26219 | } |
| 26220 | |
| 26221 | /* End of Constant: '<S885>/Enable_TX_CCVS1_00' */ |
| 26222 | /* End of Outputs for SubSystem: '<S894>/CCVS1_00' */ |
| 26223 | /* End of Outputs for SubSystem: '<S895>/CCVS1_00' */ |
| 26224 | |
| 26225 | /* DataTypeConversion: '<S891>/Data Type Conversion' incorporates: |
| 26226 | * Constant: '<S890>/Constant' |
| 26227 | */ |
| 26228 | L4_MABX_B.DataTypeConversion_dl = L4_MABX_P.Constant_Value_jk; |
| 26229 | |
| 26230 | /* DataTypeConversion: '<S891>/Data Type Conversion1' */ |
| 26231 | L4_MABX_B.DataTypeConversion1_cd = (uint16_T)L4_MABX_B.DataTypeConversion_dl; |
| 26232 | |
| 26233 | /* S-Function (sfix_bitop): '<S922>/Operator' */ |
| 26234 | L4_MABX_B.Operator_e2q = (uint16_T)(L4_MABX_B.DataTypeConversion1_cd & |
| 26235 | L4_MABX_P.Operator_BitMask_dx); |
| 26236 | |
| 26237 | /* DataTypeConversion: '<S922>/DataType' */ |
| 26238 | tmp = L4_MABX_B.Operator_e2q; |
| 26239 | if (tmp > 255) { |
| 26240 | tmp = 255U; |
| 26241 | } |
| 26242 | |
| 26243 | L4_MABX_B.DataType_as = (uint8_T)tmp; |
| 26244 | |
| 26245 | /* End of DataTypeConversion: '<S922>/DataType' */ |
| 26246 | |
| 26247 | /* S-Function (sfix_bitop): '<S923>/Operator' */ |
| 26248 | L4_MABX_B.Operator_oc = (uint16_T)(L4_MABX_B.DataTypeConversion1_cd & |
| 26249 | L4_MABX_P.Operator_BitMask_jf); |
| 26250 | |
| 26251 | /* DataTypeConversion: '<S923>/DataType' */ |
| 26252 | L4_MABX_B.DataType_mv = L4_MABX_B.Operator_oc; |
| 26253 | |
| 26254 | /* ArithShift: '<S891>/Shift_Arithmetic ' */ |
| 26255 | L4_MABX_B.Shift_Arithmetic_o4 = (uint16_T)((uint32_T)L4_MABX_B.DataType_mv >> |
| 26256 | 8); |
| 26257 | |
| 26258 | /* DataTypeConversion: '<S891>/Data Type Conversion2' */ |
| 26259 | tmp = L4_MABX_B.Shift_Arithmetic_o4; |
| 26260 | if (tmp > 255) { |
| 26261 | tmp = 255U; |
| 26262 | } |
| 26263 | |
| 26264 | L4_MABX_B.DataTypeConversion2_mp = (uint8_T)tmp; |
| 26265 | |
| 26266 | /* End of DataTypeConversion: '<S891>/Data Type Conversion2' */ |
| 26267 | |
| 26268 | /* DataTypeConversion: '<S886>/Data Type Conversion1' incorporates: |
| 26269 | * Constant: '<S891>/Constant' |
| 26270 | */ |
| 26271 | L4_MABX_B.DataTypeConversion1_ff[0] = L4_MABX_P.Constant_Value_fh; |
| 26272 | L4_MABX_B.DataTypeConversion1_ff[1] = L4_MABX_P.Constant_Value_fh; |
| 26273 | L4_MABX_B.DataTypeConversion1_ff[2] = L4_MABX_P.Constant_Value_fh; |
| 26274 | L4_MABX_B.DataTypeConversion1_ff[3] = L4_MABX_P.Constant_Value_fh; |
| 26275 | L4_MABX_B.DataTypeConversion1_ff[4] = L4_MABX_P.Constant_Value_fh; |
| 26276 | L4_MABX_B.DataTypeConversion1_ff[5] = L4_MABX_P.Constant_Value_fh; |
| 26277 | L4_MABX_B.DataTypeConversion1_ff[6] = L4_MABX_B.DataType_as; |
| 26278 | L4_MABX_B.DataTypeConversion1_ff[7] = L4_MABX_B.DataTypeConversion2_mp; |
| 26279 | |
| 26280 | /* RateTransition: '<S898>/TmpRTBAtHiddenBuf_InsertedFor_PropB_REAX_5_E4_at_inport_10Inport1' */ |
| 26281 | L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_P = L4_MABX_B.Operator_nc; |
| 26282 | |
| 26283 | /* Outputs for Enabled SubSystem: '<S898>/PropB_REAX_5_E4' incorporates: |
| 26284 | * EnablePort: '<S900>/Enable' |
| 26285 | */ |
| 26286 | if (L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_P) { |
| 26287 | /* S-Function (rti_commonblock): '<S900>/S-Function1' incorporates: |
| 26288 | * Constant: '<S898>/Constant' |
| 26289 | * Constant: '<S898>/Constant1' |
| 26290 | */ |
| 26291 | /* This comment workarounds a code generation problem */ |
| 26292 | |
| 26293 | /* dSPACE RTICAN TX Message Block: "PropB_REAX_5_E4" Id:419429092 */ |
| 26294 | { |
| 26295 | static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 26296 | 0x00 }; |
| 26297 | |
| 26298 | Float32 delayTime = 0.0; |
| 26299 | |
| 26300 | /* link this pointer to CAN_Msg for use in initialize_io_units() */ |
| 26301 | CANTP1_PTR_M1_C2_XTD_0x18FFFAE4 = &(CAN_Msg[0]); |
| 26302 | |
| 26303 | /* ... perform loop-back if required */ |
| 26304 | if (L4_MABX_P.Constant1_Value_cb > 0.5) { |
| 26305 | /* ... updating the used tx-clientbuffer */ |
| 26306 | can_tp1_msg_update_all( CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->module, |
| 26307 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->queue ); |
| 26308 | |
| 26309 | /* ... Read status and timestamp info perform loop-back (previous message) */ |
| 26310 | can_tp1_tx_msg_read_loopback(CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4, |
| 26311 | 8, // datalen |
| 26312 | &(CAN_Msg[0]), |
| 26313 | CANTP1_RX_SPMSG_M1_C2_XTD); |
| 26314 | |
| 26315 | /* Convert timestamp */ |
| 26316 | if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->processed) { |
| 26317 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp = |
| 26318 | rtk_dsts_time_to_simtime_convert |
| 26319 | (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp); |
| 26320 | } |
| 26321 | } else { |
| 26322 | /* ... Read status and timestamp info (previous message) */ |
| 26323 | can_tp1_msg_read_from_dsmcr(CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4); |
| 26324 | |
| 26325 | /* Convert timestamp */ |
| 26326 | if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->processed) { |
| 26327 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp = |
| 26328 | rtk_dsts_time_to_simtime_convert |
| 26329 | (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp); |
| 26330 | } |
| 26331 | } |
| 26332 | |
| 26333 | /* Messages with timestamp zero have been received in pause/stop state |
| 26334 | and must not be handled. |
| 26335 | */ |
| 26336 | if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp > 0.0) { |
| 26337 | L4_MABX_B.SFunction1_o1_a3 = (real_T) |
| 26338 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->processed; |
| 26339 | L4_MABX_B.SFunction1_o2_ob = (real_T) |
| 26340 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp; |
| 26341 | L4_MABX_B.SFunction1_o3_bj = (real_T) |
| 26342 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->deltatime; |
| 26343 | L4_MABX_B.SFunction1_o4_kp = (real_T) |
| 26344 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->delaytime; |
| 26345 | } |
| 26346 | |
| 26347 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 26348 | { |
| 26349 | rtican_Signal_t CAN_Sgn; |
| 26350 | UInt32 i; |
| 26351 | |
| 26352 | /* Initialize the static message data to zero */ |
| 26353 | for (i=0; i<8; i++ ) |
| 26354 | CAN_Msg[i] = 0; |
| 26355 | |
| 26356 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 26357 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26358 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ff[0] ) |
| 26359 | + 0.5); |
| 26360 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26361 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26362 | |
| 26363 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 26364 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26365 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ff[1] ) |
| 26366 | + 0.5); |
| 26367 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26368 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 26369 | |
| 26370 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 26371 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26372 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ff[2] ) |
| 26373 | + 0.5); |
| 26374 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26375 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 26376 | |
| 26377 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 26378 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26379 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ff[3] ) |
| 26380 | + 0.5); |
| 26381 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26382 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 26383 | |
| 26384 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 26385 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26386 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ff[4] ) |
| 26387 | + 0.5); |
| 26388 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26389 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 26390 | |
| 26391 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 26392 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26393 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ff[5] ) |
| 26394 | + 0.5); |
| 26395 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26396 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 26397 | |
| 26398 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 26399 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26400 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ff[6] ) |
| 26401 | + 0.5); |
| 26402 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26403 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 26404 | |
| 26405 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 26406 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26407 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ff[7] ) |
| 26408 | + 0.5); |
| 26409 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26410 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 26411 | } |
| 26412 | |
| 26413 | delayTime = (Float32) L4_MABX_P.Constant_Value_jq / (1700); |
| 26414 | |
| 26415 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 26416 | can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FFFAE4], 8, |
| 26417 | &(CAN_Msg[0]), delayTime); |
| 26418 | } |
| 26419 | } |
| 26420 | |
| 26421 | /* End of Outputs for SubSystem: '<S898>/PropB_REAX_5_E4' */ |
| 26422 | |
| 26423 | /* RateTransition: '<S899>/TmpRTBAtHiddenBuf_InsertedFor_PropB_REAX_5_E4_at_inport_10Inport1' */ |
| 26424 | L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_k = L4_MABX_B.EnablePropB_ReAX_CAN6; |
| 26425 | |
| 26426 | /* Outputs for Enabled SubSystem: '<S899>/PropB_REAX_5_E4' incorporates: |
| 26427 | * EnablePort: '<S901>/Enable' |
| 26428 | */ |
| 26429 | if (L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_k) { |
| 26430 | /* S-Function (rti_commonblock): '<S901>/S-Function1' incorporates: |
| 26431 | * Constant: '<S899>/Constant' |
| 26432 | * Constant: '<S899>/Constant1' |
| 26433 | */ |
| 26434 | /* This comment workarounds a code generation problem */ |
| 26435 | |
| 26436 | /* dSPACE RTICAN TX Message Block: "PropB_REAX_5_E4" Id:419429092 */ |
| 26437 | { |
| 26438 | static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 26439 | 0x00 }; |
| 26440 | |
| 26441 | Float32 delayTime = 0.0; |
| 26442 | |
| 26443 | /* link this pointer to CAN_Msg for use in initialize_io_units() */ |
| 26444 | CANTP1_PTR_M3_C2_XTD_0x18FFFAE4 = &(CAN_Msg[0]); |
| 26445 | |
| 26446 | /* ... perform loop-back if required */ |
| 26447 | if (L4_MABX_P.Constant1_Value_no > 0.5) { |
| 26448 | /* ... updating the used tx-clientbuffer */ |
| 26449 | can_tp1_msg_update_all( CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->module, |
| 26450 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->queue ); |
| 26451 | |
| 26452 | /* ... Read status and timestamp info perform loop-back (previous message) */ |
| 26453 | can_tp1_tx_msg_read_loopback(CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4, |
| 26454 | 8, // datalen |
| 26455 | &(CAN_Msg[0]), |
| 26456 | CANTP1_RX_SPMSG_M3_C2_XTD); |
| 26457 | |
| 26458 | /* Convert timestamp */ |
| 26459 | if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->processed) { |
| 26460 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp = |
| 26461 | rtk_dsts_time_to_simtime_convert |
| 26462 | (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp); |
| 26463 | } |
| 26464 | } else { |
| 26465 | /* ... Read status and timestamp info (previous message) */ |
| 26466 | can_tp1_msg_read_from_dsmcr(CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4); |
| 26467 | |
| 26468 | /* Convert timestamp */ |
| 26469 | if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->processed) { |
| 26470 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp = |
| 26471 | rtk_dsts_time_to_simtime_convert |
| 26472 | (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp); |
| 26473 | } |
| 26474 | } |
| 26475 | |
| 26476 | /* Messages with timestamp zero have been received in pause/stop state |
| 26477 | and must not be handled. |
| 26478 | */ |
| 26479 | if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp > 0.0) { |
| 26480 | L4_MABX_B.SFunction1_o1_nz = (real_T) |
| 26481 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->processed; |
| 26482 | L4_MABX_B.SFunction1_o2_ed = (real_T) |
| 26483 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp; |
| 26484 | L4_MABX_B.SFunction1_o3_o = (real_T) |
| 26485 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->deltatime; |
| 26486 | L4_MABX_B.SFunction1_o4_k = (real_T) |
| 26487 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->delaytime; |
| 26488 | } |
| 26489 | |
| 26490 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 26491 | { |
| 26492 | rtican_Signal_t CAN_Sgn; |
| 26493 | UInt32 i; |
| 26494 | |
| 26495 | /* Initialize the static message data to zero */ |
| 26496 | for (i=0; i<8; i++ ) |
| 26497 | CAN_Msg[i] = 0; |
| 26498 | |
| 26499 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 26500 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26501 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ff[0] ) |
| 26502 | + 0.5); |
| 26503 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26504 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26505 | |
| 26506 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 26507 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26508 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ff[1] ) |
| 26509 | + 0.5); |
| 26510 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26511 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 26512 | |
| 26513 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 26514 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26515 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ff[2] ) |
| 26516 | + 0.5); |
| 26517 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26518 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 26519 | |
| 26520 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 26521 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26522 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ff[3] ) |
| 26523 | + 0.5); |
| 26524 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26525 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 26526 | |
| 26527 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 26528 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26529 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ff[4] ) |
| 26530 | + 0.5); |
| 26531 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26532 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 26533 | |
| 26534 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 26535 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26536 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ff[5] ) |
| 26537 | + 0.5); |
| 26538 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26539 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 26540 | |
| 26541 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 26542 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26543 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ff[6] ) |
| 26544 | + 0.5); |
| 26545 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26546 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 26547 | |
| 26548 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 26549 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26550 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ff[7] ) |
| 26551 | + 0.5); |
| 26552 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26553 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 26554 | } |
| 26555 | |
| 26556 | delayTime = (Float32) L4_MABX_P.Constant_Value_pk / (1700); |
| 26557 | |
| 26558 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 26559 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0X18FFFAE4], 8, |
| 26560 | &(CAN_Msg[0]), delayTime); |
| 26561 | } |
| 26562 | } |
| 26563 | |
| 26564 | /* End of Outputs for SubSystem: '<S899>/PropB_REAX_5_E4' */ |
| 26565 | |
| 26566 | /* DataTypeConversion: '<S918>/Data Type Conversion' */ |
| 26567 | L4_MABX_B.DataTypeConversion_j4 = L4_MABX_B.SID_i; |
| 26568 | |
| 26569 | /* DataTypeConversion: '<S918>/Data Type Conversion1' */ |
| 26570 | L4_MABX_B.DataTypeConversion1_f5 = L4_MABX_B.COGReference_f; |
| 26571 | |
| 26572 | /* DataTypeConversion: '<S918>/Data Type Conversion2' */ |
| 26573 | L4_MABX_B.DataTypeConversion2_m = L4_MABX_B.CourseOverGround_f; |
| 26574 | |
| 26575 | /* DataTypeConversion: '<S918>/Data Type Conversion3' */ |
| 26576 | L4_MABX_B.DataTypeConversion3_jy = L4_MABX_B.SpeedOverGround_b; |
| 26577 | |
| 26578 | /* DataTypeConversion: '<S888>/Data Type Conversion2' incorporates: |
| 26579 | * Constant: '<S859>/enableCOGSRapidUpdateTX' |
| 26580 | */ |
| 26581 | L4_MABX_B.DataTypeConversion2_k5 = L4_MABX_P.enableCOGSRapidUpdateTX_Value; |
| 26582 | |
| 26583 | /* Outputs for Enabled SubSystem: '<S918>/Std_COGSOGRapidUpdate_01' incorporates: |
| 26584 | * EnablePort: '<S919>/Enable' |
| 26585 | */ |
| 26586 | if (L4_MABX_B.DataTypeConversion2_k5) { |
| 26587 | /* S-Function (rti_commonblock): '<S919>/S-Function1' incorporates: |
| 26588 | * Constant: '<S918>/Constant' |
| 26589 | * Constant: '<S918>/Constant1' |
| 26590 | */ |
| 26591 | /* This comment workarounds a code generation problem */ |
| 26592 | |
| 26593 | /* dSPACE RTICAN TX Message Block: "Std_COGSOGRapidUpdate_01" Id:7 */ |
| 26594 | { |
| 26595 | static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 26596 | 0x00 }; |
| 26597 | |
| 26598 | Float32 delayTime = 0.0; |
| 26599 | |
| 26600 | /* link this pointer to CAN_Msg for use in initialize_io_units() */ |
| 26601 | CANTP1_PTR_M3_C2_STD_0x7 = &(CAN_Msg[0]); |
| 26602 | |
| 26603 | /* ... perform loop-back if required */ |
| 26604 | if (L4_MABX_P.Constant1_Value_cj > 0.5) { |
| 26605 | /* ... updating the used tx-clientbuffer */ |
| 26606 | can_tp1_msg_update_all( CANTP1_TX_M3_C2_MCRCLT_STD_0X7->module, |
| 26607 | CANTP1_TX_M3_C2_MCRCLT_STD_0X7->queue ); |
| 26608 | |
| 26609 | /* ... Read status and timestamp info perform loop-back (previous message) */ |
| 26610 | can_tp1_tx_msg_read_loopback(CANTP1_TX_M3_C2_MCRCLT_STD_0X7, |
| 26611 | 8, // datalen |
| 26612 | &(CAN_Msg[0]), |
| 26613 | CANTP1_RX_SPMSG_M3_C2_STD); |
| 26614 | |
| 26615 | /* Convert timestamp */ |
| 26616 | if (CANTP1_TX_M3_C2_MCRCLT_STD_0X7->processed) { |
| 26617 | CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp = |
| 26618 | rtk_dsts_time_to_simtime_convert |
| 26619 | (CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp); |
| 26620 | } |
| 26621 | } else { |
| 26622 | /* ... Read status and timestamp info (previous message) */ |
| 26623 | can_tp1_msg_read_from_dsmcr(CANTP1_TX_M3_C2_MCRCLT_STD_0X7); |
| 26624 | |
| 26625 | /* Convert timestamp */ |
| 26626 | if (CANTP1_TX_M3_C2_MCRCLT_STD_0X7->processed) { |
| 26627 | CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp = |
| 26628 | rtk_dsts_time_to_simtime_convert |
| 26629 | (CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp); |
| 26630 | } |
| 26631 | } |
| 26632 | |
| 26633 | /* Messages with timestamp zero have been received in pause/stop state |
| 26634 | and must not be handled. |
| 26635 | */ |
| 26636 | if (CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp > 0.0) { |
| 26637 | L4_MABX_B.SFunction1_o1_oy = (real_T) |
| 26638 | CANTP1_TX_M3_C2_MCRCLT_STD_0X7->processed; |
| 26639 | L4_MABX_B.SFunction1_o2_jm = (real_T) |
| 26640 | CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp; |
| 26641 | L4_MABX_B.SFunction1_o3_lx = (real_T) |
| 26642 | CANTP1_TX_M3_C2_MCRCLT_STD_0X7->deltatime; |
| 26643 | L4_MABX_B.SFunction1_o4_fwb = (real_T) |
| 26644 | CANTP1_TX_M3_C2_MCRCLT_STD_0X7->delaytime; |
| 26645 | } |
| 26646 | |
| 26647 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 26648 | { |
| 26649 | rtican_Signal_t CAN_Sgn; |
| 26650 | UInt32 i; |
| 26651 | |
| 26652 | /* Initialize the static message data to zero */ |
| 26653 | for (i=0; i<8; i++ ) |
| 26654 | CAN_Msg[i] = 0; |
| 26655 | |
| 26656 | /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */ |
| 26657 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26658 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_j4 ) + |
| 26659 | 0.5); |
| 26660 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26661 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26662 | |
| 26663 | /* ...... "COGReference" (8|2, standard signal, unsigned int, little endian) */ |
| 26664 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26665 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_f5 ) + |
| 26666 | 0.5); |
| 26667 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26668 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 26669 | |
| 26670 | /* ...... "CourseOverGround" (16|16, standard signal, unsigned int, little endian) */ |
| 26671 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26672 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion2_m - ( 0 ) |
| 26673 | ) / 0.0001 + 0.5); |
| 26674 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 26675 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 26676 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte1; |
| 26677 | |
| 26678 | /* ...... "SpeedOverGround" (32|16, standard signal, unsigned int, little endian) */ |
| 26679 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26680 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion3_jy - ( 0 |
| 26681 | ) ) / 0.01 + 0.5); |
| 26682 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 26683 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 26684 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte1; |
| 26685 | } |
| 26686 | |
| 26687 | /* mask unused bits with '1' */ |
| 26688 | CAN_Msg[1] |= 0xFC; |
| 26689 | CAN_Msg[6] |= 0xFF; |
| 26690 | CAN_Msg[7] |= 0xFF; |
| 26691 | delayTime = (Float32) L4_MABX_P.Constant_Value_b / (2000); |
| 26692 | |
| 26693 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 26694 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X7], 8, &(CAN_Msg[0]), |
| 26695 | delayTime); |
| 26696 | } |
| 26697 | } |
| 26698 | |
| 26699 | /* End of Outputs for SubSystem: '<S918>/Std_COGSOGRapidUpdate_01' */ |
| 26700 | |
| 26701 | /* DataTypeConversion: '<S889>/Data Type Conversion2' incorporates: |
| 26702 | * Constant: '<S859>/enableEBC1_8B_TX' |
| 26703 | */ |
| 26704 | L4_MABX_B.DataTypeConversion2_ow = L4_MABX_P.enableEBC1_8B_TX_Value; |
| 26705 | |
| 26706 | /* Outputs for Enabled SubSystem: '<S920>/EBC1_TX' incorporates: |
| 26707 | * EnablePort: '<S921>/Enable' |
| 26708 | */ |
| 26709 | if (L4_MABX_B.DataTypeConversion2_ow) { |
| 26710 | /* S-Function (rti_commonblock): '<S921>/S-Function1' */ |
| 26711 | /* This comment workarounds a code generation problem */ |
| 26712 | |
| 26713 | /* dSPACE RTICAN TX Message Block: "EBC1_TX" Id:418382219 */ |
| 26714 | { |
| 26715 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 26716 | |
| 26717 | Float32 delayTime = 0.0; |
| 26718 | |
| 26719 | /* ... Read status and timestamp info (previous message) */ |
| 26720 | can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]); |
| 26721 | |
| 26722 | /* Convert timestamp */ |
| 26723 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->processed) { |
| 26724 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->timestamp = |
| 26725 | rtk_dsts_time_to_simtime_convert |
| 26726 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->timestamp); |
| 26727 | } |
| 26728 | |
| 26729 | /* Messages with timestamp zero have been received in pause/stop state |
| 26730 | and must not be handled. |
| 26731 | */ |
| 26732 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->timestamp > 0.0) { |
| 26733 | L4_MABX_B.SFunction1_o1_fc = (real_T) |
| 26734 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->processed; |
| 26735 | L4_MABX_B.SFunction1_o2_km = (real_T) |
| 26736 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->timestamp; |
| 26737 | L4_MABX_B.SFunction1_o3_bb = (real_T) |
| 26738 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->deltatime; |
| 26739 | L4_MABX_B.SFunction1_o4_b = (real_T) |
| 26740 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->delaytime; |
| 26741 | } |
| 26742 | |
| 26743 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 26744 | { |
| 26745 | rtican_Signal_t CAN_Sgn; |
| 26746 | |
| 26747 | /* ...... "ASREngCtrlActive" (0|2, standard signal, unsigned int, little endian) */ |
| 26748 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26749 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ASREngCtrlActive ) + 0.5); |
| 26750 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26751 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26752 | |
| 26753 | /* ...... "ASRBrakeCtrlActive" (2|2, standard signal, unsigned int, little endian) */ |
| 26754 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26755 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ASRBrakeCtrlActive ) + 0.5); |
| 26756 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26757 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 26758 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26759 | |
| 26760 | /* ...... "AntiLockBrakingActive" (4|2, standard signal, unsigned int, little endian) */ |
| 26761 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26762 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AntiLockBrakingActive ) + |
| 26763 | 0.5); |
| 26764 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26765 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 26766 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26767 | |
| 26768 | /* ...... "EBSBrakeSwitch" (6|2, standard signal, unsigned int, little endian) */ |
| 26769 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26770 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EBSBrakeSwitch_j ) + 0.5); |
| 26771 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26772 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 26773 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26774 | |
| 26775 | /* ...... "BrakePedalPos" (8|8, standard signal, unsigned int, little endian) */ |
| 26776 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26777 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.BrakePedalPos - ( 0 ) ) / |
| 26778 | 0.4 + 0.5); |
| 26779 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26780 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 26781 | |
| 26782 | /* ...... "ABSOffroadSwitch" (16|2, standard signal, unsigned int, little endian) */ |
| 26783 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26784 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ABSOffroadSwitch ) + 0.5); |
| 26785 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26786 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 26787 | |
| 26788 | /* ...... "ASROffroadSwitch" (18|2, standard signal, unsigned int, little endian) */ |
| 26789 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26790 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ASROffroadSwitch ) + 0.5); |
| 26791 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26792 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 26793 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 26794 | |
| 26795 | /* ...... "ASRHillHolderSwitch" (20|2, standard signal, unsigned int, little endian) */ |
| 26796 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26797 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ASRHillHolderSwitch ) + 0.5); |
| 26798 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26799 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 26800 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 26801 | |
| 26802 | /* ...... "TractionCtrlOverrideSwitch" (22|2, standard signal, unsigned int, little endian) */ |
| 26803 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26804 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.TractionCtrlOverrideSwitch ) |
| 26805 | + 0.5); |
| 26806 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26807 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 26808 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 26809 | |
| 26810 | /* ...... "AccelInterlockSwitch" (24|2, standard signal, unsigned int, little endian) */ |
| 26811 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26812 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AccelInterlockSwitch ) + 0.5); |
| 26813 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26814 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 26815 | |
| 26816 | /* ...... "EngDerateSwitch" (26|2, standard signal, unsigned int, little endian) */ |
| 26817 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26818 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngDerateSwitch ) + 0.5); |
| 26819 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26820 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 26821 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 26822 | |
| 26823 | /* ...... "EngAuxShutdownSwitch" (28|2, standard signal, unsigned int, little endian) */ |
| 26824 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26825 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngAuxShutdownSwitch ) + 0.5); |
| 26826 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26827 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 26828 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 26829 | |
| 26830 | /* ...... "RemoteAccelEnableSwitch" (30|2, standard signal, unsigned int, little endian) */ |
| 26831 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26832 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.RemoteAccelEnableSwitch ) + |
| 26833 | 0.5); |
| 26834 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26835 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 26836 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 26837 | |
| 26838 | /* ...... "EngRetarderSelection" (32|8, standard signal, unsigned int, little endian) */ |
| 26839 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26840 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngRetarderSelection - ( 0 ) |
| 26841 | ) / 0.4 + 0.5); |
| 26842 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26843 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 26844 | |
| 26845 | /* ...... "ABSFullyOperational" (40|2, standard signal, unsigned int, little endian) */ |
| 26846 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26847 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ABSFullyOperational ) + 0.5); |
| 26848 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26849 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 26850 | |
| 26851 | /* ...... "EBSRedWarningSignal" (42|2, standard signal, unsigned int, little endian) */ |
| 26852 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26853 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EBSRedWarningSignal ) + 0.5); |
| 26854 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26855 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 26856 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 26857 | |
| 26858 | /* ...... "ABS_EBSAmberWarningSignal" (44|2, standard signal, unsigned int, little endian) */ |
| 26859 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26860 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ABS_EBSAmberWarningSignal ) |
| 26861 | + 0.5); |
| 26862 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26863 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 26864 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 26865 | |
| 26866 | /* ...... "ATC_ASRInformationSignal" (46|2, standard signal, unsigned int, little endian) */ |
| 26867 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26868 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ATC_ASRInformationSignal ) + |
| 26869 | 0.5); |
| 26870 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26871 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 26872 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 26873 | |
| 26874 | /* ...... "SrcAddrssOfCtrllngDvcFrBrkCntrl" (48|8, standard signal, unsigned int, little endian) */ |
| 26875 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26876 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 26877 | (( L4_MABX_B.SrcAddrssOfCtrllngDvcFrBrkCntrl ) + 0.5); |
| 26878 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26879 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 26880 | |
| 26881 | /* ...... "HaltBrakeSwitch" (58|2, standard signal, unsigned int, little endian) */ |
| 26882 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26883 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.HaltBrakeSwitch ) + 0.5); |
| 26884 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26885 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 26886 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 26887 | |
| 26888 | /* ...... "TrailerABSStatus" (60|2, standard signal, unsigned int, little endian) */ |
| 26889 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26890 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.TrailerABSStatus ) + 0.5); |
| 26891 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26892 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 26893 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 26894 | |
| 26895 | /* ...... "TrctrMntdTrilerABSWarningSignal" (62|2, standard signal, unsigned int, little endian) */ |
| 26896 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26897 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 26898 | (( L4_MABX_B.TrctrMntdTrilerABSWarningSignal ) + 0.5); |
| 26899 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26900 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 26901 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 26902 | } |
| 26903 | |
| 26904 | /* mask unused bits with '1' */ |
| 26905 | CAN_Msg[7] |= 0x03; |
| 26906 | |
| 26907 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 26908 | can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B], 8, |
| 26909 | &(CAN_Msg[0]), delayTime); |
| 26910 | } |
| 26911 | } |
| 26912 | |
| 26913 | /* End of Outputs for SubSystem: '<S920>/EBC1_TX' */ |
| 26914 | |
| 26915 | /* End of Outputs for SubSystem: '<S855>/CAN_TX_100ms' */ |
| 26916 | |
| 26917 | /* DiscretePulseGenerator: '<S1083>/Flash' */ |
| 26918 | L4_MABX_B.Flash = (L4_MABX_DW.clockTickCounter_k < L4_MABX_P.Flash_Duty) && |
| 26919 | (L4_MABX_DW.clockTickCounter_k >= 0) ? L4_MABX_P.Flash_Amp : 0.0; |
| 26920 | if (L4_MABX_DW.clockTickCounter_k >= L4_MABX_P.Flash_Period - 1.0) { |
| 26921 | L4_MABX_DW.clockTickCounter_k = 0; |
| 26922 | } else { |
| 26923 | L4_MABX_DW.clockTickCounter_k++; |
| 26924 | } |
| 26925 | |
| 26926 | /* End of DiscretePulseGenerator: '<S1083>/Flash' */ |
| 26927 | /* user code (Output function Trailer for TID3) */ |
| 26928 | |
| 26929 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 26930 | /* EventChannel: 0 */ |
| 26931 | if (tid == 0) { |
| 26932 | DSXCP_service(0); |
| 26933 | } |
| 26934 | |
| 26935 | /* If subsystem generates rate grouping Output functions, |
| 26936 | * when tid is used in Output function for one rate, |
| 26937 | * all Output functions include tid as a local variable. |
| 26938 | * As result, some Output functions may have unused tid. |
| 26939 | */ |
| 26940 | UNUSED_PARAMETER(tid); |
| 26941 | } |
| 26942 | |
| 26943 | /* Model update function for TID3 */ |
| 26944 | void L4_MABX_update3(void) /* Sample time: [0.1s, 0.0s] */ |
| 26945 | { |
| 26946 | /* Update for Atomic SubSystem: '<S855>/CAN_TX_100ms' */ |
| 26947 | |
| 26948 | /* Update for Enabled SubSystem: '<S892>/Rolling_15_counter' incorporates: |
| 26949 | * EnablePort: '<S934>/Enable' |
| 26950 | */ |
| 26951 | if (L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_R) { |
| 26952 | /* Update for UnitDelay: '<S934>/Unit_Delay' */ |
| 26953 | L4_MABX_DW.Unit_Delay_DSTATE = L4_MABX_B.FixPtSwitch; |
| 26954 | } |
| 26955 | |
| 26956 | /* End of Update for SubSystem: '<S892>/Rolling_15_counter' */ |
| 26957 | |
| 26958 | /* End of Update for SubSystem: '<S855>/CAN_TX_100ms' */ |
| 26959 | |
| 26960 | /* Update for RateTransition: '<S1083>/TmpRTBAtFlashOutport1' */ |
| 26961 | L4_MABX_DW.TmpRTBAtFlashOutport1_Buffer0 = L4_MABX_B.Flash; |
| 26962 | } |
| 26963 | |
| 26964 | /* Model output function for TID4 */ |
| 26965 | void L4_MABX_output4(void) /* Sample time: [0.25s, 0.0s] */ |
| 26966 | { |
| 26967 | int_T tid = 4; |
| 26968 | |
| 26969 | /* user code (Output function Trailer for TID4) */ |
| 26970 | |
| 26971 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 26972 | /* EventChannel: 0 */ |
| 26973 | if (tid == 0) { |
| 26974 | DSXCP_service(0); |
| 26975 | } |
| 26976 | |
| 26977 | /* If subsystem generates rate grouping Output functions, |
| 26978 | * when tid is used in Output function for one rate, |
| 26979 | * all Output functions include tid as a local variable. |
| 26980 | * As result, some Output functions may have unused tid. |
| 26981 | */ |
| 26982 | UNUSED_PARAMETER(tid); |
| 26983 | } |
| 26984 | |
| 26985 | /* Model update function for TID4 */ |
| 26986 | void L4_MABX_update4(void) /* Sample time: [0.25s, 0.0s] */ |
| 26987 | { |
| 26988 | /* (no update code required) */ |
| 26989 | } |
| 26990 | |
| 26991 | /* Model output function for TID5 */ |
| 26992 | void L4_MABX_output5(void) /* Sample time: [0.5s, 0.0s] */ |
| 26993 | { |
| 26994 | int_T tid = 5; |
| 26995 | boolean_T zcEvent; |
| 26996 | uint32_T q0; |
| 26997 | uint32_T qY; |
| 26998 | |
| 26999 | /* S-Function (rti_commonblock): '<S28>/S-Function1' */ |
| 27000 | /* This comment workarounds a code generation problem */ |
| 27001 | |
| 27002 | /* dSPACE RTICAN Status block */ |
| 27003 | /* ... read status variables of the CAN microcontroller */ |
| 27004 | { |
| 27005 | UInt32 loop_counter, memory, j; |
| 27006 | for (j=0;j<=9;j++) { |
| 27007 | rtican_type1_tq_error[0][6] = can_tp1_service_read |
| 27008 | (can_type1_service_M1_C1[j]); |
| 27009 | loop_counter = 0; |
| 27010 | while ((rtican_type1_tq_error[0][6] = can_tp1_service_request |
| 27011 | (can_type1_service_M1_C1[j]))== DSMCOM_BUFFER_OVERFLOW) { |
| 27012 | loop_counter++; |
| 27013 | if (loop_counter > MAX_LOOP) { |
| 27014 | memory = rtican_type1_error_level; |
| 27015 | rtican_type1_error_level = 1; |
| 27016 | rtican_type1_tq_err_sig(0, 6); |
| 27017 | rtican_type1_error_level = memory; |
| 27018 | break; |
| 27019 | } |
| 27020 | } |
| 27021 | |
| 27022 | if (j==CANTP1_M1_C1_RXLost) { |
| 27023 | rtican_type1_tq_error[0][6] = can_tp1_service_read |
| 27024 | (can_type1_service_M1_C1[CANTP1_M1_C1_DataLost]); |
| 27025 | loop_counter = 0; |
| 27026 | while ((rtican_type1_tq_error[0][6] = can_tp1_service_request |
| 27027 | (can_type1_service_M1_C1[CANTP1_M1_C1_DataLost]))== |
| 27028 | DSMCOM_BUFFER_OVERFLOW) { |
| 27029 | loop_counter++; |
| 27030 | if (loop_counter > MAX_LOOP) { |
| 27031 | memory = rtican_type1_error_level; |
| 27032 | rtican_type1_error_level = 1; |
| 27033 | rtican_type1_tq_err_sig(0, 6); |
| 27034 | rtican_type1_error_level = memory; |
| 27035 | break; |
| 27036 | } |
| 27037 | } |
| 27038 | } |
| 27039 | } |
| 27040 | |
| 27041 | L4_MABX_B.SFunction1_o1_kx = (UInt32) |
| 27042 | can_type1_service_M1_C1[CANTP1_M1_C1_Status]->data0; |
| 27043 | DIAG_CAN1_Count_Stuff_Errors = (UInt32) |
| 27044 | can_type1_service_M1_C1[CANTP1_M1_C1_StuffErrors]->data0; |
| 27045 | DIAG_CAN1_Count_Format_Errors = (UInt32) |
| 27046 | can_type1_service_M1_C1[CANTP1_M1_C1_FormatErrors]->data0; |
| 27047 | DIAG_CAN1_Count_Ack_Errors = (UInt32) |
| 27048 | can_type1_service_M1_C1[CANTP1_M1_C1_AckErrors]->data0; |
| 27049 | DIAG_CAN1_Count_Bit0_Errors = (UInt32) |
| 27050 | can_type1_service_M1_C1[CANTP1_M1_C1_Bit0Errors]->data0; |
| 27051 | DIAG_CAN1_Count_Bit1_Errors = (UInt32) |
| 27052 | can_type1_service_M1_C1[CANTP1_M1_C1_Bit1Errors]->data0; |
| 27053 | DIAG_CAN1_Count_CRC_Errors = (UInt32) |
| 27054 | can_type1_service_M1_C1[CANTP1_M1_C1_CRCErrors]->data0; |
| 27055 | DIAG_CAN1_Count_RX_Lost = (UInt32) |
| 27056 | (can_type1_service_M1_C1[CANTP1_M1_C1_RXLost]->data0 + |
| 27057 | can_type1_service_M1_C1[CANTP1_M1_C1_DataLost]->data0); |
| 27058 | DIAG_CAN1_Count_RX_OK = (UInt32) can_type1_service_M1_C1[CANTP1_M1_C1_RXOK |
| 27059 | ]->data0; |
| 27060 | DIAG_CAN1_Count_TX_OK = (UInt32) can_type1_service_M1_C1[CANTP1_M1_C1_TXOK |
| 27061 | ]->data0; |
| 27062 | } |
| 27063 | |
| 27064 | /* DataTypeConversion: '<S1>/Data Type Conversion' */ |
| 27065 | DIAG_CAN1_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI |
| 27066 | ((int32_T)L4_MABX_B.SFunction1_o1_kx); |
| 27067 | |
| 27068 | /* RelationalOperator: '<S22>/Operator' incorporates: |
| 27069 | * Constant: '<S1>/Constant' |
| 27070 | */ |
| 27071 | L4_MABX_B.Operator_euc = (L4_MABX_P.Constant_Value_c == DIAG_CAN1_Status); |
| 27072 | |
| 27073 | /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_1' incorporates: |
| 27074 | * EnablePort: '<S11>/Enable' |
| 27075 | */ |
| 27076 | if (L4_MABX_B.Operator_euc) { |
| 27077 | /* Reshape: '<S30>/Reshape' incorporates: |
| 27078 | * Constant: '<S30>/Constant' |
| 27079 | */ |
| 27080 | L4_MABX_B.Reshape_g[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_l[0]; |
| 27081 | L4_MABX_B.Reshape_g[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_l[1]; |
| 27082 | |
| 27083 | /* UnitDelay: '<S30>/Unit_Delay' */ |
| 27084 | L4_MABX_B.Unit_Delay_h4 = L4_MABX_DW.Unit_Delay_DSTATE_f1; |
| 27085 | |
| 27086 | /* UnitDelay: '<S31>/Unit Delay' */ |
| 27087 | L4_MABX_B.UnitDelay_f4 = L4_MABX_DW.UnitDelay_DSTATE_j1; |
| 27088 | |
| 27089 | /* Switch: '<S34>/Switch1' incorporates: |
| 27090 | * Constant: '<S31>/E' |
| 27091 | * Constant: '<S31>/IV' |
| 27092 | * Switch: '<S33>/Switch1' |
| 27093 | */ |
| 27094 | if (L4_MABX_B.Unit_Delay_h4) { |
| 27095 | L4_MABX_B.Switch1_o = L4_MABX_P.IV_Value_m; |
| 27096 | } else { |
| 27097 | if (L4_MABX_P.E_Value) { |
| 27098 | /* Sum: '<S31>/Subtract' incorporates: |
| 27099 | * Constant: '<S31>/Constant' |
| 27100 | * Switch: '<S33>/Switch1' |
| 27101 | */ |
| 27102 | q0 = L4_MABX_P.Constant_Value_jc; |
| 27103 | qY = q0 + L4_MABX_B.UnitDelay_f4; |
| 27104 | if (qY < q0) { |
| 27105 | qY = MAX_uint32_T; |
| 27106 | } |
| 27107 | |
| 27108 | L4_MABX_B.Subtract_ot = qY; |
| 27109 | |
| 27110 | /* End of Sum: '<S31>/Subtract' */ |
| 27111 | |
| 27112 | /* Switch: '<S33>/Switch1' */ |
| 27113 | L4_MABX_B.Switch1_az = L4_MABX_B.Subtract_ot; |
| 27114 | } else { |
| 27115 | /* Switch: '<S33>/Switch1' */ |
| 27116 | L4_MABX_B.Switch1_az = L4_MABX_B.UnitDelay_f4; |
| 27117 | } |
| 27118 | |
| 27119 | L4_MABX_B.Switch1_o = L4_MABX_B.Switch1_az; |
| 27120 | } |
| 27121 | |
| 27122 | /* End of Switch: '<S34>/Switch1' */ |
| 27123 | |
| 27124 | /* Selector: '<S30>/Selector' */ |
| 27125 | L4_MABX_B.Selector_d = L4_MABX_B.Reshape_g[(int32_T)L4_MABX_B.Switch1_o - 1]; |
| 27126 | |
| 27127 | /* Outputs for Triggered SubSystem: '<S11>/CAN_TYPE1_BOR_M1_C1' incorporates: |
| 27128 | * TriggerPort: '<S29>/Trigger' |
| 27129 | */ |
| 27130 | zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C1_Trig_ZCE == POS_ZCSIG) != |
| 27131 | (int32_T)L4_MABX_B.Selector_d) && |
| 27132 | (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C1_Trig_ZCE != |
| 27133 | UNINITIALIZED_ZCSIG)); |
| 27134 | if (zcEvent) { |
| 27135 | /* S-Function (rti_commonblock): '<S29>/S-Function1' */ |
| 27136 | /* This comment workarounds a code generation problem */ |
| 27137 | |
| 27138 | /* dSPACE RTICAN Bus Off Recovery block */ |
| 27139 | /* ... Perform software-reset of the CAN microcontroller */ |
| 27140 | { |
| 27141 | UInt32 loop_counter, memory; |
| 27142 | loop_counter = 0; |
| 27143 | while ((rtican_type1_tq_error[0][0] = can_tp1_channel_BOff_return |
| 27144 | (can_type1_channel_M1_C1)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27145 | loop_counter++; |
| 27146 | if (loop_counter > MAX_LOOP) { |
| 27147 | memory = rtican_type1_error_level; |
| 27148 | rtican_type1_error_level = 1; |
| 27149 | rtican_type1_tq_err_sig(0, 0); |
| 27150 | rtican_type1_error_level = memory; |
| 27151 | break; |
| 27152 | } |
| 27153 | } |
| 27154 | |
| 27155 | while ((rtican_type1_tq_error[0][0] = can_tp1_channel_all_wakeup |
| 27156 | (can_type1_channel_M1_C1)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27157 | loop_counter++; |
| 27158 | if (loop_counter > MAX_LOOP) { |
| 27159 | memory = rtican_type1_error_level; |
| 27160 | rtican_type1_error_level = 1; |
| 27161 | rtican_type1_tq_err_sig(0, 0); |
| 27162 | rtican_type1_error_level = memory; |
| 27163 | break; |
| 27164 | } |
| 27165 | } |
| 27166 | } |
| 27167 | } |
| 27168 | |
| 27169 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C1_Trig_ZCE = L4_MABX_B.Selector_d; |
| 27170 | |
| 27171 | /* End of Outputs for SubSystem: '<S11>/CAN_TYPE1_BOR_M1_C1' */ |
| 27172 | |
| 27173 | /* RelationalOperator: '<S32>/Operator' */ |
| 27174 | L4_MABX_B.Operator_f5 = (L4_MABX_B.Switch1_o == L4_MABX_ConstB.Width_p); |
| 27175 | } |
| 27176 | |
| 27177 | /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_1' */ |
| 27178 | |
| 27179 | /* S-Function (rti_commonblock): '<S20>/S-Function1' */ |
| 27180 | /* This comment workarounds a code generation problem */ |
| 27181 | |
| 27182 | /* dSPACE RTICAN Status block */ |
| 27183 | /* ... read status variables of the CAN microcontroller */ |
| 27184 | { |
| 27185 | UInt32 loop_counter, memory, j; |
| 27186 | for (j=0;j<=9;j++) { |
| 27187 | rtican_type1_tq_error[2][6] = can_tp1_service_read |
| 27188 | (can_type1_service_M3_C1[j]); |
| 27189 | loop_counter = 0; |
| 27190 | while ((rtican_type1_tq_error[2][6] = can_tp1_service_request |
| 27191 | (can_type1_service_M3_C1[j]))== DSMCOM_BUFFER_OVERFLOW) { |
| 27192 | loop_counter++; |
| 27193 | if (loop_counter > MAX_LOOP) { |
| 27194 | memory = rtican_type1_error_level; |
| 27195 | rtican_type1_error_level = 1; |
| 27196 | rtican_type1_tq_err_sig(2, 6); |
| 27197 | rtican_type1_error_level = memory; |
| 27198 | break; |
| 27199 | } |
| 27200 | } |
| 27201 | |
| 27202 | if (j==CANTP1_M3_C1_RXLost) { |
| 27203 | rtican_type1_tq_error[2][6] = can_tp1_service_read |
| 27204 | (can_type1_service_M3_C1[CANTP1_M3_C1_DataLost]); |
| 27205 | loop_counter = 0; |
| 27206 | while ((rtican_type1_tq_error[2][6] = can_tp1_service_request |
| 27207 | (can_type1_service_M3_C1[CANTP1_M3_C1_DataLost]))== |
| 27208 | DSMCOM_BUFFER_OVERFLOW) { |
| 27209 | loop_counter++; |
| 27210 | if (loop_counter > MAX_LOOP) { |
| 27211 | memory = rtican_type1_error_level; |
| 27212 | rtican_type1_error_level = 1; |
| 27213 | rtican_type1_tq_err_sig(2, 6); |
| 27214 | rtican_type1_error_level = memory; |
| 27215 | break; |
| 27216 | } |
| 27217 | } |
| 27218 | } |
| 27219 | } |
| 27220 | |
| 27221 | L4_MABX_B.SFunction1_o1_g3j = (UInt32) |
| 27222 | can_type1_service_M3_C1[CANTP1_M3_C1_Status]->data0; |
| 27223 | DIAG_CAN5_Count_Stuff_Errors = (UInt32) |
| 27224 | can_type1_service_M3_C1[CANTP1_M3_C1_StuffErrors]->data0; |
| 27225 | DIAG_CAN5_Count_Format_Errors = (UInt32) |
| 27226 | can_type1_service_M3_C1[CANTP1_M3_C1_FormatErrors]->data0; |
| 27227 | DIAG_CAN5_Count_Ack_Errors = (UInt32) |
| 27228 | can_type1_service_M3_C1[CANTP1_M3_C1_AckErrors]->data0; |
| 27229 | DIAG_CAN5_Count_Bit0_Errors = (UInt32) |
| 27230 | can_type1_service_M3_C1[CANTP1_M3_C1_Bit0Errors]->data0; |
| 27231 | DIAG_CAN5_Count_Bit1_Errors = (UInt32) |
| 27232 | can_type1_service_M3_C1[CANTP1_M3_C1_Bit1Errors]->data0; |
| 27233 | DIAG_CAN5_Count_CRC_Errors = (UInt32) |
| 27234 | can_type1_service_M3_C1[CANTP1_M3_C1_CRCErrors]->data0; |
| 27235 | DIAG_CAN5_Count_RX_Lost = (UInt32) |
| 27236 | (can_type1_service_M3_C1[CANTP1_M3_C1_RXLost]->data0 + |
| 27237 | can_type1_service_M3_C1[CANTP1_M3_C1_DataLost]->data0); |
| 27238 | DIAG_CAN5_Count_RX_OK = (UInt32) can_type1_service_M3_C1[CANTP1_M3_C1_RXOK |
| 27239 | ]->data0; |
| 27240 | DIAG_CAN5_Count_TX_OK = (UInt32) can_type1_service_M3_C1[CANTP1_M3_C1_TXOK |
| 27241 | ]->data0; |
| 27242 | } |
| 27243 | |
| 27244 | /* DataTypeConversion: '<S1>/Data Type Conversion5' */ |
| 27245 | DIAG_CAN5_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI |
| 27246 | ((int32_T)L4_MABX_B.SFunction1_o1_g3j); |
| 27247 | |
| 27248 | /* RelationalOperator: '<S26>/Operator' incorporates: |
| 27249 | * Constant: '<S1>/Constant4' |
| 27250 | */ |
| 27251 | L4_MABX_B.Operator_msz = (L4_MABX_P.Constant4_Value_np == DIAG_CAN5_Status); |
| 27252 | |
| 27253 | /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_5' incorporates: |
| 27254 | * EnablePort: '<S15>/Enable' |
| 27255 | */ |
| 27256 | if (L4_MABX_B.Operator_msz) { |
| 27257 | /* Reshape: '<S54>/Reshape' incorporates: |
| 27258 | * Constant: '<S54>/Constant' |
| 27259 | */ |
| 27260 | L4_MABX_B.Reshape_a[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_j[0]; |
| 27261 | L4_MABX_B.Reshape_a[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_j[1]; |
| 27262 | |
| 27263 | /* UnitDelay: '<S54>/Unit_Delay' */ |
| 27264 | L4_MABX_B.Unit_Delay_p1 = L4_MABX_DW.Unit_Delay_DSTATE_i5; |
| 27265 | |
| 27266 | /* UnitDelay: '<S55>/Unit Delay' */ |
| 27267 | L4_MABX_B.UnitDelay_j = L4_MABX_DW.UnitDelay_DSTATE_p; |
| 27268 | |
| 27269 | /* Switch: '<S58>/Switch1' incorporates: |
| 27270 | * Constant: '<S55>/E' |
| 27271 | * Constant: '<S55>/IV' |
| 27272 | * Switch: '<S57>/Switch1' |
| 27273 | */ |
| 27274 | if (L4_MABX_B.Unit_Delay_p1) { |
| 27275 | L4_MABX_B.Switch1_k = L4_MABX_P.IV_Value_h; |
| 27276 | } else { |
| 27277 | if (L4_MABX_P.E_Value_db) { |
| 27278 | /* Sum: '<S55>/Subtract' incorporates: |
| 27279 | * Constant: '<S55>/Constant' |
| 27280 | * Switch: '<S57>/Switch1' |
| 27281 | */ |
| 27282 | q0 = L4_MABX_P.Constant_Value_jg; |
| 27283 | qY = q0 + L4_MABX_B.UnitDelay_j; |
| 27284 | if (qY < q0) { |
| 27285 | qY = MAX_uint32_T; |
| 27286 | } |
| 27287 | |
| 27288 | L4_MABX_B.Subtract_m = qY; |
| 27289 | |
| 27290 | /* End of Sum: '<S55>/Subtract' */ |
| 27291 | |
| 27292 | /* Switch: '<S57>/Switch1' */ |
| 27293 | L4_MABX_B.Switch1_l = L4_MABX_B.Subtract_m; |
| 27294 | } else { |
| 27295 | /* Switch: '<S57>/Switch1' */ |
| 27296 | L4_MABX_B.Switch1_l = L4_MABX_B.UnitDelay_j; |
| 27297 | } |
| 27298 | |
| 27299 | L4_MABX_B.Switch1_k = L4_MABX_B.Switch1_l; |
| 27300 | } |
| 27301 | |
| 27302 | /* End of Switch: '<S58>/Switch1' */ |
| 27303 | |
| 27304 | /* Selector: '<S54>/Selector' */ |
| 27305 | L4_MABX_B.Selector_p = L4_MABX_B.Reshape_a[(int32_T)L4_MABX_B.Switch1_k - 1]; |
| 27306 | |
| 27307 | /* Outputs for Triggered SubSystem: '<S15>/CAN_TYPE1_BOR_M3_C1' incorporates: |
| 27308 | * TriggerPort: '<S53>/Trigger' |
| 27309 | */ |
| 27310 | zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C1_Trig_ZCE == POS_ZCSIG) != |
| 27311 | (int32_T)L4_MABX_B.Selector_p) && |
| 27312 | (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C1_Trig_ZCE != |
| 27313 | UNINITIALIZED_ZCSIG)); |
| 27314 | if (zcEvent) { |
| 27315 | /* S-Function (rti_commonblock): '<S53>/S-Function1' */ |
| 27316 | /* This comment workarounds a code generation problem */ |
| 27317 | |
| 27318 | /* dSPACE RTICAN Bus Off Recovery block */ |
| 27319 | /* ... Perform software-reset of the CAN microcontroller */ |
| 27320 | { |
| 27321 | UInt32 loop_counter, memory; |
| 27322 | loop_counter = 0; |
| 27323 | while ((rtican_type1_tq_error[2][0] = can_tp1_channel_BOff_return |
| 27324 | (can_type1_channel_M3_C1)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27325 | loop_counter++; |
| 27326 | if (loop_counter > MAX_LOOP) { |
| 27327 | memory = rtican_type1_error_level; |
| 27328 | rtican_type1_error_level = 1; |
| 27329 | rtican_type1_tq_err_sig(2, 0); |
| 27330 | rtican_type1_error_level = memory; |
| 27331 | break; |
| 27332 | } |
| 27333 | } |
| 27334 | |
| 27335 | while ((rtican_type1_tq_error[2][0] = can_tp1_channel_all_wakeup |
| 27336 | (can_type1_channel_M3_C1)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27337 | loop_counter++; |
| 27338 | if (loop_counter > MAX_LOOP) { |
| 27339 | memory = rtican_type1_error_level; |
| 27340 | rtican_type1_error_level = 1; |
| 27341 | rtican_type1_tq_err_sig(2, 0); |
| 27342 | rtican_type1_error_level = memory; |
| 27343 | break; |
| 27344 | } |
| 27345 | } |
| 27346 | } |
| 27347 | } |
| 27348 | |
| 27349 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C1_Trig_ZCE = L4_MABX_B.Selector_p; |
| 27350 | |
| 27351 | /* End of Outputs for SubSystem: '<S15>/CAN_TYPE1_BOR_M3_C1' */ |
| 27352 | |
| 27353 | /* RelationalOperator: '<S56>/Operator' */ |
| 27354 | L4_MABX_B.Operator_ho = (L4_MABX_B.Switch1_k == L4_MABX_ConstB.Width_a); |
| 27355 | } |
| 27356 | |
| 27357 | /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_5' */ |
| 27358 | |
| 27359 | /* S-Function (rti_commonblock): '<S21>/S-Function1' */ |
| 27360 | /* This comment workarounds a code generation problem */ |
| 27361 | |
| 27362 | /* dSPACE RTICAN Status block */ |
| 27363 | /* ... read status variables of the CAN microcontroller */ |
| 27364 | { |
| 27365 | UInt32 loop_counter, memory, j; |
| 27366 | for (j=0;j<=9;j++) { |
| 27367 | rtican_type1_tq_error[2][6] = can_tp1_service_read |
| 27368 | (can_type1_service_M3_C2[j]); |
| 27369 | loop_counter = 0; |
| 27370 | while ((rtican_type1_tq_error[2][6] = can_tp1_service_request |
| 27371 | (can_type1_service_M3_C2[j]))== DSMCOM_BUFFER_OVERFLOW) { |
| 27372 | loop_counter++; |
| 27373 | if (loop_counter > MAX_LOOP) { |
| 27374 | memory = rtican_type1_error_level; |
| 27375 | rtican_type1_error_level = 1; |
| 27376 | rtican_type1_tq_err_sig(2, 6); |
| 27377 | rtican_type1_error_level = memory; |
| 27378 | break; |
| 27379 | } |
| 27380 | } |
| 27381 | |
| 27382 | if (j==CANTP1_M3_C2_RXLost) { |
| 27383 | rtican_type1_tq_error[2][6] = can_tp1_service_read |
| 27384 | (can_type1_service_M3_C2[CANTP1_M3_C2_DataLost]); |
| 27385 | loop_counter = 0; |
| 27386 | while ((rtican_type1_tq_error[2][6] = can_tp1_service_request |
| 27387 | (can_type1_service_M3_C2[CANTP1_M3_C2_DataLost]))== |
| 27388 | DSMCOM_BUFFER_OVERFLOW) { |
| 27389 | loop_counter++; |
| 27390 | if (loop_counter > MAX_LOOP) { |
| 27391 | memory = rtican_type1_error_level; |
| 27392 | rtican_type1_error_level = 1; |
| 27393 | rtican_type1_tq_err_sig(2, 6); |
| 27394 | rtican_type1_error_level = memory; |
| 27395 | break; |
| 27396 | } |
| 27397 | } |
| 27398 | } |
| 27399 | } |
| 27400 | |
| 27401 | L4_MABX_B.SFunction1_o1_ar5 = (UInt32) |
| 27402 | can_type1_service_M3_C2[CANTP1_M3_C2_Status]->data0; |
| 27403 | DIAG_CAN6_Count_Stuff_Errors = (UInt32) |
| 27404 | can_type1_service_M3_C2[CANTP1_M3_C2_StuffErrors]->data0; |
| 27405 | DIAG_CAN6_Count_Format_Errors = (UInt32) |
| 27406 | can_type1_service_M3_C2[CANTP1_M3_C2_FormatErrors]->data0; |
| 27407 | DIAG_CAN6_Count_Ack_Errors = (UInt32) |
| 27408 | can_type1_service_M3_C2[CANTP1_M3_C2_AckErrors]->data0; |
| 27409 | DIAG_CAN6_Count_Bit0_Errors = (UInt32) |
| 27410 | can_type1_service_M3_C2[CANTP1_M3_C2_Bit0Errors]->data0; |
| 27411 | DIAG_CAN6_Count_Bit1_Errors = (UInt32) |
| 27412 | can_type1_service_M3_C2[CANTP1_M3_C2_Bit1Errors]->data0; |
| 27413 | DIAG_CAN6_Count_CRC_Errors = (UInt32) |
| 27414 | can_type1_service_M3_C2[CANTP1_M3_C2_CRCErrors]->data0; |
| 27415 | DIAG_CAN6_Count_RX_Lost = (UInt32) |
| 27416 | (can_type1_service_M3_C2[CANTP1_M3_C2_RXLost]->data0 + |
| 27417 | can_type1_service_M3_C2[CANTP1_M3_C2_DataLost]->data0); |
| 27418 | DIAG_CAN6_Count_RX_OK = (UInt32) can_type1_service_M3_C2[CANTP1_M3_C2_RXOK |
| 27419 | ]->data0; |
| 27420 | DIAG_CAN6_Count_TX_OK = (UInt32) can_type1_service_M3_C2[CANTP1_M3_C2_TXOK |
| 27421 | ]->data0; |
| 27422 | } |
| 27423 | |
| 27424 | /* DataTypeConversion: '<S1>/Data Type Conversion4' */ |
| 27425 | DIAG_CAN6_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI |
| 27426 | ((int32_T)L4_MABX_B.SFunction1_o1_ar5); |
| 27427 | |
| 27428 | /* RelationalOperator: '<S27>/Operator' incorporates: |
| 27429 | * Constant: '<S1>/Constant5' |
| 27430 | */ |
| 27431 | L4_MABX_B.Operator_fv = (L4_MABX_P.Constant5_Value_m == DIAG_CAN6_Status); |
| 27432 | |
| 27433 | /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_6' incorporates: |
| 27434 | * EnablePort: '<S16>/Enable' |
| 27435 | */ |
| 27436 | if (L4_MABX_B.Operator_fv) { |
| 27437 | /* Reshape: '<S60>/Reshape' incorporates: |
| 27438 | * Constant: '<S60>/Constant' |
| 27439 | */ |
| 27440 | L4_MABX_B.Reshape_j[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_e[0]; |
| 27441 | L4_MABX_B.Reshape_j[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_e[1]; |
| 27442 | |
| 27443 | /* UnitDelay: '<S60>/Unit_Delay' */ |
| 27444 | L4_MABX_B.Unit_Delay_mw = L4_MABX_DW.Unit_Delay_DSTATE_l5; |
| 27445 | |
| 27446 | /* UnitDelay: '<S61>/Unit Delay' */ |
| 27447 | L4_MABX_B.UnitDelay_av = L4_MABX_DW.UnitDelay_DSTATE_dr; |
| 27448 | |
| 27449 | /* Switch: '<S64>/Switch1' incorporates: |
| 27450 | * Constant: '<S61>/E' |
| 27451 | * Constant: '<S61>/IV' |
| 27452 | * Switch: '<S63>/Switch1' |
| 27453 | */ |
| 27454 | if (L4_MABX_B.Unit_Delay_mw) { |
| 27455 | L4_MABX_B.Switch1_h = L4_MABX_P.IV_Value_ey; |
| 27456 | } else { |
| 27457 | if (L4_MABX_P.E_Value_c) { |
| 27458 | /* Sum: '<S61>/Subtract' incorporates: |
| 27459 | * Constant: '<S61>/Constant' |
| 27460 | * Switch: '<S63>/Switch1' |
| 27461 | */ |
| 27462 | q0 = L4_MABX_P.Constant_Value_iu; |
| 27463 | qY = q0 + L4_MABX_B.UnitDelay_av; |
| 27464 | if (qY < q0) { |
| 27465 | qY = MAX_uint32_T; |
| 27466 | } |
| 27467 | |
| 27468 | L4_MABX_B.Subtract_fc = qY; |
| 27469 | |
| 27470 | /* End of Sum: '<S61>/Subtract' */ |
| 27471 | |
| 27472 | /* Switch: '<S63>/Switch1' */ |
| 27473 | L4_MABX_B.Switch1_bs = L4_MABX_B.Subtract_fc; |
| 27474 | } else { |
| 27475 | /* Switch: '<S63>/Switch1' */ |
| 27476 | L4_MABX_B.Switch1_bs = L4_MABX_B.UnitDelay_av; |
| 27477 | } |
| 27478 | |
| 27479 | L4_MABX_B.Switch1_h = L4_MABX_B.Switch1_bs; |
| 27480 | } |
| 27481 | |
| 27482 | /* End of Switch: '<S64>/Switch1' */ |
| 27483 | |
| 27484 | /* Selector: '<S60>/Selector' */ |
| 27485 | L4_MABX_B.Selector_h = L4_MABX_B.Reshape_j[(int32_T)L4_MABX_B.Switch1_h - 1]; |
| 27486 | |
| 27487 | /* Outputs for Triggered SubSystem: '<S16>/CAN_TYPE1_BOR_M3_C2' incorporates: |
| 27488 | * TriggerPort: '<S59>/Trigger' |
| 27489 | */ |
| 27490 | zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C2_Trig_ZCE == POS_ZCSIG) != |
| 27491 | (int32_T)L4_MABX_B.Selector_h) && |
| 27492 | (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C2_Trig_ZCE != |
| 27493 | UNINITIALIZED_ZCSIG)); |
| 27494 | if (zcEvent) { |
| 27495 | /* S-Function (rti_commonblock): '<S59>/S-Function1' */ |
| 27496 | /* This comment workarounds a code generation problem */ |
| 27497 | |
| 27498 | /* dSPACE RTICAN Bus Off Recovery block */ |
| 27499 | /* ... Perform software-reset of the CAN microcontroller */ |
| 27500 | { |
| 27501 | UInt32 loop_counter, memory; |
| 27502 | loop_counter = 0; |
| 27503 | while ((rtican_type1_tq_error[2][0] = can_tp1_channel_BOff_return |
| 27504 | (can_type1_channel_M3_C2)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27505 | loop_counter++; |
| 27506 | if (loop_counter > MAX_LOOP) { |
| 27507 | memory = rtican_type1_error_level; |
| 27508 | rtican_type1_error_level = 1; |
| 27509 | rtican_type1_tq_err_sig(2, 0); |
| 27510 | rtican_type1_error_level = memory; |
| 27511 | break; |
| 27512 | } |
| 27513 | } |
| 27514 | |
| 27515 | while ((rtican_type1_tq_error[2][0] = can_tp1_channel_all_wakeup |
| 27516 | (can_type1_channel_M3_C2)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27517 | loop_counter++; |
| 27518 | if (loop_counter > MAX_LOOP) { |
| 27519 | memory = rtican_type1_error_level; |
| 27520 | rtican_type1_error_level = 1; |
| 27521 | rtican_type1_tq_err_sig(2, 0); |
| 27522 | rtican_type1_error_level = memory; |
| 27523 | break; |
| 27524 | } |
| 27525 | } |
| 27526 | } |
| 27527 | } |
| 27528 | |
| 27529 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C2_Trig_ZCE = L4_MABX_B.Selector_h; |
| 27530 | |
| 27531 | /* End of Outputs for SubSystem: '<S16>/CAN_TYPE1_BOR_M3_C2' */ |
| 27532 | |
| 27533 | /* RelationalOperator: '<S62>/Operator' */ |
| 27534 | L4_MABX_B.Operator_bg = (L4_MABX_B.Switch1_h == L4_MABX_ConstB.Width); |
| 27535 | } |
| 27536 | |
| 27537 | /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_6' */ |
| 27538 | |
| 27539 | /* S-Function (rti_commonblock): '<S18>/S-Function1' */ |
| 27540 | /* This comment workarounds a code generation problem */ |
| 27541 | |
| 27542 | /* dSPACE RTICAN Status block */ |
| 27543 | /* ... read status variables of the CAN microcontroller */ |
| 27544 | { |
| 27545 | UInt32 loop_counter, memory, j; |
| 27546 | for (j=0;j<=9;j++) { |
| 27547 | rtican_type1_tq_error[1][6] = can_tp1_service_read |
| 27548 | (can_type1_service_M2_C1[j]); |
| 27549 | loop_counter = 0; |
| 27550 | while ((rtican_type1_tq_error[1][6] = can_tp1_service_request |
| 27551 | (can_type1_service_M2_C1[j]))== DSMCOM_BUFFER_OVERFLOW) { |
| 27552 | loop_counter++; |
| 27553 | if (loop_counter > MAX_LOOP) { |
| 27554 | memory = rtican_type1_error_level; |
| 27555 | rtican_type1_error_level = 1; |
| 27556 | rtican_type1_tq_err_sig(1, 6); |
| 27557 | rtican_type1_error_level = memory; |
| 27558 | break; |
| 27559 | } |
| 27560 | } |
| 27561 | |
| 27562 | if (j==CANTP1_M2_C1_RXLost) { |
| 27563 | rtican_type1_tq_error[1][6] = can_tp1_service_read |
| 27564 | (can_type1_service_M2_C1[CANTP1_M2_C1_DataLost]); |
| 27565 | loop_counter = 0; |
| 27566 | while ((rtican_type1_tq_error[1][6] = can_tp1_service_request |
| 27567 | (can_type1_service_M2_C1[CANTP1_M2_C1_DataLost]))== |
| 27568 | DSMCOM_BUFFER_OVERFLOW) { |
| 27569 | loop_counter++; |
| 27570 | if (loop_counter > MAX_LOOP) { |
| 27571 | memory = rtican_type1_error_level; |
| 27572 | rtican_type1_error_level = 1; |
| 27573 | rtican_type1_tq_err_sig(1, 6); |
| 27574 | rtican_type1_error_level = memory; |
| 27575 | break; |
| 27576 | } |
| 27577 | } |
| 27578 | } |
| 27579 | } |
| 27580 | |
| 27581 | L4_MABX_B.SFunction1_o1_h4 = (UInt32) |
| 27582 | can_type1_service_M2_C1[CANTP1_M2_C1_Status]->data0; |
| 27583 | DIAG_CAN3_Count_Stuff_Errors = (UInt32) |
| 27584 | can_type1_service_M2_C1[CANTP1_M2_C1_StuffErrors]->data0; |
| 27585 | DIAG_CAN3_Count_Format_Errors = (UInt32) |
| 27586 | can_type1_service_M2_C1[CANTP1_M2_C1_FormatErrors]->data0; |
| 27587 | DIAG_CAN3_Count_Ack_Errors = (UInt32) |
| 27588 | can_type1_service_M2_C1[CANTP1_M2_C1_AckErrors]->data0; |
| 27589 | DIAG_CAN3_Count_Bit0_Errors = (UInt32) |
| 27590 | can_type1_service_M2_C1[CANTP1_M2_C1_Bit0Errors]->data0; |
| 27591 | DIAG_CAN3_Count_Bit1_Errors = (UInt32) |
| 27592 | can_type1_service_M2_C1[CANTP1_M2_C1_Bit1Errors]->data0; |
| 27593 | DIAG_CAN3_Count_CRC_Errors = (UInt32) |
| 27594 | can_type1_service_M2_C1[CANTP1_M2_C1_CRCErrors]->data0; |
| 27595 | DIAG_CAN3_Count_RX_Lost = (UInt32) |
| 27596 | (can_type1_service_M2_C1[CANTP1_M2_C1_RXLost]->data0 + |
| 27597 | can_type1_service_M2_C1[CANTP1_M2_C1_DataLost]->data0); |
| 27598 | DIAG_CAN3_Count_RX_OK = (UInt32) can_type1_service_M2_C1[CANTP1_M2_C1_RXOK |
| 27599 | ]->data0; |
| 27600 | DIAG_CAN3_Count_TX_OK = (UInt32) can_type1_service_M2_C1[CANTP1_M2_C1_TXOK |
| 27601 | ]->data0; |
| 27602 | } |
| 27603 | |
| 27604 | /* DataTypeConversion: '<S1>/Data Type Conversion3' */ |
| 27605 | DIAG_CAN3_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI |
| 27606 | ((int32_T)L4_MABX_B.SFunction1_o1_h4); |
| 27607 | |
| 27608 | /* RelationalOperator: '<S24>/Operator' incorporates: |
| 27609 | * Constant: '<S1>/Constant1' |
| 27610 | */ |
| 27611 | L4_MABX_B.Operator_bsh = (L4_MABX_P.Constant1_Value_c0 == DIAG_CAN3_Status); |
| 27612 | |
| 27613 | /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_3' incorporates: |
| 27614 | * EnablePort: '<S13>/Enable' |
| 27615 | */ |
| 27616 | if (L4_MABX_B.Operator_bsh) { |
| 27617 | /* Reshape: '<S42>/Reshape' incorporates: |
| 27618 | * Constant: '<S42>/Constant' |
| 27619 | */ |
| 27620 | L4_MABX_B.Reshape_iq[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_o[0]; |
| 27621 | L4_MABX_B.Reshape_iq[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_o[1]; |
| 27622 | |
| 27623 | /* UnitDelay: '<S42>/Unit_Delay' */ |
| 27624 | L4_MABX_B.Unit_Delay_m0 = L4_MABX_DW.Unit_Delay_DSTATE_h41; |
| 27625 | |
| 27626 | /* UnitDelay: '<S43>/Unit Delay' */ |
| 27627 | L4_MABX_B.UnitDelay_d = L4_MABX_DW.UnitDelay_DSTATE_dr4; |
| 27628 | |
| 27629 | /* Switch: '<S46>/Switch1' incorporates: |
| 27630 | * Constant: '<S43>/E' |
| 27631 | * Constant: '<S43>/IV' |
| 27632 | * Switch: '<S45>/Switch1' |
| 27633 | */ |
| 27634 | if (L4_MABX_B.Unit_Delay_m0) { |
| 27635 | L4_MABX_B.Switch1_k4 = L4_MABX_P.IV_Value_b; |
| 27636 | } else { |
| 27637 | if (L4_MABX_P.E_Value_d) { |
| 27638 | /* Sum: '<S43>/Subtract' incorporates: |
| 27639 | * Constant: '<S43>/Constant' |
| 27640 | * Switch: '<S45>/Switch1' |
| 27641 | */ |
| 27642 | q0 = L4_MABX_P.Constant_Value_h3; |
| 27643 | qY = q0 + L4_MABX_B.UnitDelay_d; |
| 27644 | if (qY < q0) { |
| 27645 | qY = MAX_uint32_T; |
| 27646 | } |
| 27647 | |
| 27648 | L4_MABX_B.Subtract_h = qY; |
| 27649 | |
| 27650 | /* End of Sum: '<S43>/Subtract' */ |
| 27651 | |
| 27652 | /* Switch: '<S45>/Switch1' */ |
| 27653 | L4_MABX_B.Switch1_fr = L4_MABX_B.Subtract_h; |
| 27654 | } else { |
| 27655 | /* Switch: '<S45>/Switch1' */ |
| 27656 | L4_MABX_B.Switch1_fr = L4_MABX_B.UnitDelay_d; |
| 27657 | } |
| 27658 | |
| 27659 | L4_MABX_B.Switch1_k4 = L4_MABX_B.Switch1_fr; |
| 27660 | } |
| 27661 | |
| 27662 | /* End of Switch: '<S46>/Switch1' */ |
| 27663 | |
| 27664 | /* Selector: '<S42>/Selector' */ |
| 27665 | L4_MABX_B.Selector_g = L4_MABX_B.Reshape_iq[(int32_T)L4_MABX_B.Switch1_k4 - |
| 27666 | 1]; |
| 27667 | |
| 27668 | /* Outputs for Triggered SubSystem: '<S13>/CAN_TYPE1_BOR_M2_C1' incorporates: |
| 27669 | * TriggerPort: '<S41>/Trigger' |
| 27670 | */ |
| 27671 | zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C1_Trig_ZCE == POS_ZCSIG) != |
| 27672 | (int32_T)L4_MABX_B.Selector_g) && |
| 27673 | (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C1_Trig_ZCE != |
| 27674 | UNINITIALIZED_ZCSIG)); |
| 27675 | if (zcEvent) { |
| 27676 | /* S-Function (rti_commonblock): '<S41>/S-Function1' */ |
| 27677 | /* This comment workarounds a code generation problem */ |
| 27678 | |
| 27679 | /* dSPACE RTICAN Bus Off Recovery block */ |
| 27680 | /* ... Perform software-reset of the CAN microcontroller */ |
| 27681 | { |
| 27682 | UInt32 loop_counter, memory; |
| 27683 | loop_counter = 0; |
| 27684 | while ((rtican_type1_tq_error[1][0] = can_tp1_channel_BOff_return |
| 27685 | (can_type1_channel_M2_C1)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27686 | loop_counter++; |
| 27687 | if (loop_counter > MAX_LOOP) { |
| 27688 | memory = rtican_type1_error_level; |
| 27689 | rtican_type1_error_level = 1; |
| 27690 | rtican_type1_tq_err_sig(1, 0); |
| 27691 | rtican_type1_error_level = memory; |
| 27692 | break; |
| 27693 | } |
| 27694 | } |
| 27695 | |
| 27696 | while ((rtican_type1_tq_error[1][0] = can_tp1_channel_all_wakeup |
| 27697 | (can_type1_channel_M2_C1)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27698 | loop_counter++; |
| 27699 | if (loop_counter > MAX_LOOP) { |
| 27700 | memory = rtican_type1_error_level; |
| 27701 | rtican_type1_error_level = 1; |
| 27702 | rtican_type1_tq_err_sig(1, 0); |
| 27703 | rtican_type1_error_level = memory; |
| 27704 | break; |
| 27705 | } |
| 27706 | } |
| 27707 | } |
| 27708 | } |
| 27709 | |
| 27710 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C1_Trig_ZCE = L4_MABX_B.Selector_g; |
| 27711 | |
| 27712 | /* End of Outputs for SubSystem: '<S13>/CAN_TYPE1_BOR_M2_C1' */ |
| 27713 | |
| 27714 | /* RelationalOperator: '<S44>/Operator' */ |
| 27715 | L4_MABX_B.Operator_dh = (L4_MABX_B.Switch1_k4 == L4_MABX_ConstB.Width_iw); |
| 27716 | } |
| 27717 | |
| 27718 | /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_3' */ |
| 27719 | |
| 27720 | /* S-Function (rti_commonblock): '<S19>/S-Function1' */ |
| 27721 | /* This comment workarounds a code generation problem */ |
| 27722 | |
| 27723 | /* dSPACE RTICAN Status block */ |
| 27724 | /* ... read status variables of the CAN microcontroller */ |
| 27725 | { |
| 27726 | UInt32 loop_counter, memory, j; |
| 27727 | for (j=0;j<=9;j++) { |
| 27728 | rtican_type1_tq_error[1][6] = can_tp1_service_read |
| 27729 | (can_type1_service_M2_C2[j]); |
| 27730 | loop_counter = 0; |
| 27731 | while ((rtican_type1_tq_error[1][6] = can_tp1_service_request |
| 27732 | (can_type1_service_M2_C2[j]))== DSMCOM_BUFFER_OVERFLOW) { |
| 27733 | loop_counter++; |
| 27734 | if (loop_counter > MAX_LOOP) { |
| 27735 | memory = rtican_type1_error_level; |
| 27736 | rtican_type1_error_level = 1; |
| 27737 | rtican_type1_tq_err_sig(1, 6); |
| 27738 | rtican_type1_error_level = memory; |
| 27739 | break; |
| 27740 | } |
| 27741 | } |
| 27742 | |
| 27743 | if (j==CANTP1_M2_C2_RXLost) { |
| 27744 | rtican_type1_tq_error[1][6] = can_tp1_service_read |
| 27745 | (can_type1_service_M2_C2[CANTP1_M2_C2_DataLost]); |
| 27746 | loop_counter = 0; |
| 27747 | while ((rtican_type1_tq_error[1][6] = can_tp1_service_request |
| 27748 | (can_type1_service_M2_C2[CANTP1_M2_C2_DataLost]))== |
| 27749 | DSMCOM_BUFFER_OVERFLOW) { |
| 27750 | loop_counter++; |
| 27751 | if (loop_counter > MAX_LOOP) { |
| 27752 | memory = rtican_type1_error_level; |
| 27753 | rtican_type1_error_level = 1; |
| 27754 | rtican_type1_tq_err_sig(1, 6); |
| 27755 | rtican_type1_error_level = memory; |
| 27756 | break; |
| 27757 | } |
| 27758 | } |
| 27759 | } |
| 27760 | } |
| 27761 | |
| 27762 | L4_MABX_B.SFunction1_o1_ma = (UInt32) |
| 27763 | can_type1_service_M2_C2[CANTP1_M2_C2_Status]->data0; |
| 27764 | DIAG_CAN4_Count_Stuff_Errors = (UInt32) |
| 27765 | can_type1_service_M2_C2[CANTP1_M2_C2_StuffErrors]->data0; |
| 27766 | DIAG_CAN4_Count_Format_Errors = (UInt32) |
| 27767 | can_type1_service_M2_C2[CANTP1_M2_C2_FormatErrors]->data0; |
| 27768 | DIAG_CAN4_Count_Ack_Errors = (UInt32) |
| 27769 | can_type1_service_M2_C2[CANTP1_M2_C2_AckErrors]->data0; |
| 27770 | DIAG_CAN4_Count_Bit0_Errors = (UInt32) |
| 27771 | can_type1_service_M2_C2[CANTP1_M2_C2_Bit0Errors]->data0; |
| 27772 | DIAG_CAN4_Count_Bit1_Errors = (UInt32) |
| 27773 | can_type1_service_M2_C2[CANTP1_M2_C2_Bit1Errors]->data0; |
| 27774 | DIAG_CAN4_Count_CRC_Errors = (UInt32) |
| 27775 | can_type1_service_M2_C2[CANTP1_M2_C2_CRCErrors]->data0; |
| 27776 | DIAG_CAN4_Count_RX_Lost = (UInt32) |
| 27777 | (can_type1_service_M2_C2[CANTP1_M2_C2_RXLost]->data0 + |
| 27778 | can_type1_service_M2_C2[CANTP1_M2_C2_DataLost]->data0); |
| 27779 | DIAG_CAN4_Count_RX_OK = (UInt32) can_type1_service_M2_C2[CANTP1_M2_C2_RXOK |
| 27780 | ]->data0; |
| 27781 | DIAG_CAN4_Count_TX_OK = (UInt32) can_type1_service_M2_C2[CANTP1_M2_C2_TXOK |
| 27782 | ]->data0; |
| 27783 | } |
| 27784 | |
| 27785 | /* DataTypeConversion: '<S1>/Data Type Conversion2' */ |
| 27786 | DIAG_CAN4_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI |
| 27787 | ((int32_T)L4_MABX_B.SFunction1_o1_ma); |
| 27788 | |
| 27789 | /* RelationalOperator: '<S25>/Operator' incorporates: |
| 27790 | * Constant: '<S1>/Constant3' |
| 27791 | */ |
| 27792 | L4_MABX_B.Operator_bw = (L4_MABX_P.Constant3_Value_h == DIAG_CAN4_Status); |
| 27793 | |
| 27794 | /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_4' incorporates: |
| 27795 | * EnablePort: '<S14>/Enable' |
| 27796 | */ |
| 27797 | if (L4_MABX_B.Operator_bw) { |
| 27798 | /* Reshape: '<S48>/Reshape' incorporates: |
| 27799 | * Constant: '<S48>/Constant' |
| 27800 | */ |
| 27801 | L4_MABX_B.Reshape_n[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_n[0]; |
| 27802 | L4_MABX_B.Reshape_n[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_n[1]; |
| 27803 | |
| 27804 | /* UnitDelay: '<S48>/Unit_Delay' */ |
| 27805 | L4_MABX_B.Unit_Delay_fl = L4_MABX_DW.Unit_Delay_DSTATE_mq; |
| 27806 | |
| 27807 | /* UnitDelay: '<S49>/Unit Delay' */ |
| 27808 | L4_MABX_B.UnitDelay_l = L4_MABX_DW.UnitDelay_DSTATE_h; |
| 27809 | |
| 27810 | /* Switch: '<S52>/Switch1' incorporates: |
| 27811 | * Constant: '<S49>/E' |
| 27812 | * Constant: '<S49>/IV' |
| 27813 | * Switch: '<S51>/Switch1' |
| 27814 | */ |
| 27815 | if (L4_MABX_B.Unit_Delay_fl) { |
| 27816 | L4_MABX_B.Switch1_ex = L4_MABX_P.IV_Value_k; |
| 27817 | } else { |
| 27818 | if (L4_MABX_P.E_Value_m) { |
| 27819 | /* Sum: '<S49>/Subtract' incorporates: |
| 27820 | * Constant: '<S49>/Constant' |
| 27821 | * Switch: '<S51>/Switch1' |
| 27822 | */ |
| 27823 | q0 = L4_MABX_P.Constant_Value_o0; |
| 27824 | qY = q0 + L4_MABX_B.UnitDelay_l; |
| 27825 | if (qY < q0) { |
| 27826 | qY = MAX_uint32_T; |
| 27827 | } |
| 27828 | |
| 27829 | L4_MABX_B.Subtract_f1 = qY; |
| 27830 | |
| 27831 | /* End of Sum: '<S49>/Subtract' */ |
| 27832 | |
| 27833 | /* Switch: '<S51>/Switch1' */ |
| 27834 | L4_MABX_B.Switch1_c = L4_MABX_B.Subtract_f1; |
| 27835 | } else { |
| 27836 | /* Switch: '<S51>/Switch1' */ |
| 27837 | L4_MABX_B.Switch1_c = L4_MABX_B.UnitDelay_l; |
| 27838 | } |
| 27839 | |
| 27840 | L4_MABX_B.Switch1_ex = L4_MABX_B.Switch1_c; |
| 27841 | } |
| 27842 | |
| 27843 | /* End of Switch: '<S52>/Switch1' */ |
| 27844 | |
| 27845 | /* Selector: '<S48>/Selector' */ |
| 27846 | L4_MABX_B.Selector_i = L4_MABX_B.Reshape_n[(int32_T)L4_MABX_B.Switch1_ex - 1]; |
| 27847 | |
| 27848 | /* Outputs for Triggered SubSystem: '<S14>/CAN_TYPE1_BOR_M2_C2' incorporates: |
| 27849 | * TriggerPort: '<S47>/Trigger' |
| 27850 | */ |
| 27851 | zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C2_Trig_ZCE == POS_ZCSIG) != |
| 27852 | (int32_T)L4_MABX_B.Selector_i) && |
| 27853 | (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C2_Trig_ZCE != |
| 27854 | UNINITIALIZED_ZCSIG)); |
| 27855 | if (zcEvent) { |
| 27856 | /* S-Function (rti_commonblock): '<S47>/S-Function1' */ |
| 27857 | /* This comment workarounds a code generation problem */ |
| 27858 | |
| 27859 | /* dSPACE RTICAN Bus Off Recovery block */ |
| 27860 | /* ... Perform software-reset of the CAN microcontroller */ |
| 27861 | { |
| 27862 | UInt32 loop_counter, memory; |
| 27863 | loop_counter = 0; |
| 27864 | while ((rtican_type1_tq_error[1][0] = can_tp1_channel_BOff_return |
| 27865 | (can_type1_channel_M2_C2)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27866 | loop_counter++; |
| 27867 | if (loop_counter > MAX_LOOP) { |
| 27868 | memory = rtican_type1_error_level; |
| 27869 | rtican_type1_error_level = 1; |
| 27870 | rtican_type1_tq_err_sig(1, 0); |
| 27871 | rtican_type1_error_level = memory; |
| 27872 | break; |
| 27873 | } |
| 27874 | } |
| 27875 | |
| 27876 | while ((rtican_type1_tq_error[1][0] = can_tp1_channel_all_wakeup |
| 27877 | (can_type1_channel_M2_C2)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27878 | loop_counter++; |
| 27879 | if (loop_counter > MAX_LOOP) { |
| 27880 | memory = rtican_type1_error_level; |
| 27881 | rtican_type1_error_level = 1; |
| 27882 | rtican_type1_tq_err_sig(1, 0); |
| 27883 | rtican_type1_error_level = memory; |
| 27884 | break; |
| 27885 | } |
| 27886 | } |
| 27887 | } |
| 27888 | } |
| 27889 | |
| 27890 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C2_Trig_ZCE = L4_MABX_B.Selector_i; |
| 27891 | |
| 27892 | /* End of Outputs for SubSystem: '<S14>/CAN_TYPE1_BOR_M2_C2' */ |
| 27893 | |
| 27894 | /* RelationalOperator: '<S50>/Operator' */ |
| 27895 | L4_MABX_B.Operator_ou = (L4_MABX_B.Switch1_ex == L4_MABX_ConstB.Width_i); |
| 27896 | } |
| 27897 | |
| 27898 | /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_4' */ |
| 27899 | |
| 27900 | /* S-Function (rti_commonblock): '<S17>/S-Function1' */ |
| 27901 | /* This comment workarounds a code generation problem */ |
| 27902 | |
| 27903 | /* dSPACE RTICAN Status block */ |
| 27904 | /* ... read status variables of the CAN microcontroller */ |
| 27905 | { |
| 27906 | UInt32 loop_counter, memory, j; |
| 27907 | for (j=0;j<=9;j++) { |
| 27908 | rtican_type1_tq_error[0][6] = can_tp1_service_read |
| 27909 | (can_type1_service_M1_C2[j]); |
| 27910 | loop_counter = 0; |
| 27911 | while ((rtican_type1_tq_error[0][6] = can_tp1_service_request |
| 27912 | (can_type1_service_M1_C2[j]))== DSMCOM_BUFFER_OVERFLOW) { |
| 27913 | loop_counter++; |
| 27914 | if (loop_counter > MAX_LOOP) { |
| 27915 | memory = rtican_type1_error_level; |
| 27916 | rtican_type1_error_level = 1; |
| 27917 | rtican_type1_tq_err_sig(0, 6); |
| 27918 | rtican_type1_error_level = memory; |
| 27919 | break; |
| 27920 | } |
| 27921 | } |
| 27922 | |
| 27923 | if (j==CANTP1_M1_C2_RXLost) { |
| 27924 | rtican_type1_tq_error[0][6] = can_tp1_service_read |
| 27925 | (can_type1_service_M1_C2[CANTP1_M1_C2_DataLost]); |
| 27926 | loop_counter = 0; |
| 27927 | while ((rtican_type1_tq_error[0][6] = can_tp1_service_request |
| 27928 | (can_type1_service_M1_C2[CANTP1_M1_C2_DataLost]))== |
| 27929 | DSMCOM_BUFFER_OVERFLOW) { |
| 27930 | loop_counter++; |
| 27931 | if (loop_counter > MAX_LOOP) { |
| 27932 | memory = rtican_type1_error_level; |
| 27933 | rtican_type1_error_level = 1; |
| 27934 | rtican_type1_tq_err_sig(0, 6); |
| 27935 | rtican_type1_error_level = memory; |
| 27936 | break; |
| 27937 | } |
| 27938 | } |
| 27939 | } |
| 27940 | } |
| 27941 | |
| 27942 | L4_MABX_B.SFunction1_o1_og = (UInt32) |
| 27943 | can_type1_service_M1_C2[CANTP1_M1_C2_Status]->data0; |
| 27944 | DIAG_CAN2_Count_Stuff_Errors = (UInt32) |
| 27945 | can_type1_service_M1_C2[CANTP1_M1_C2_StuffErrors]->data0; |
| 27946 | DIAG_CAN2_Count_Format_Errors = (UInt32) |
| 27947 | can_type1_service_M1_C2[CANTP1_M1_C2_FormatErrors]->data0; |
| 27948 | DIAG_CAN2_Count_Ack_Errors = (UInt32) |
| 27949 | can_type1_service_M1_C2[CANTP1_M1_C2_AckErrors]->data0; |
| 27950 | DIAG_CAN2_Count_Bit0_Errors = (UInt32) |
| 27951 | can_type1_service_M1_C2[CANTP1_M1_C2_Bit0Errors]->data0; |
| 27952 | DIAG_CAN2_Count_Bit1_Errors = (UInt32) |
| 27953 | can_type1_service_M1_C2[CANTP1_M1_C2_Bit1Errors]->data0; |
| 27954 | DIAG_CAN2_Count_CRC_Errors = (UInt32) |
| 27955 | can_type1_service_M1_C2[CANTP1_M1_C2_CRCErrors]->data0; |
| 27956 | DIAG_CAN2_Count_RX_Lost = (UInt32) |
| 27957 | (can_type1_service_M1_C2[CANTP1_M1_C2_RXLost]->data0 + |
| 27958 | can_type1_service_M1_C2[CANTP1_M1_C2_DataLost]->data0); |
| 27959 | DIAG_CAN2_Count_RX_OK = (UInt32) can_type1_service_M1_C2[CANTP1_M1_C2_RXOK |
| 27960 | ]->data0; |
| 27961 | DIAG_CAN2_Count_TX_OK = (UInt32) can_type1_service_M1_C2[CANTP1_M1_C2_TXOK |
| 27962 | ]->data0; |
| 27963 | } |
| 27964 | |
| 27965 | /* DataTypeConversion: '<S1>/Data Type Conversion1' */ |
| 27966 | DIAG_CAN2_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI |
| 27967 | ((int32_T)L4_MABX_B.SFunction1_o1_og); |
| 27968 | |
| 27969 | /* RelationalOperator: '<S23>/Operator' incorporates: |
| 27970 | * Constant: '<S1>/Constant2' |
| 27971 | */ |
| 27972 | L4_MABX_B.Operator_eb = (L4_MABX_P.Constant2_Value_j2 == DIAG_CAN2_Status); |
| 27973 | |
| 27974 | /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_2' incorporates: |
| 27975 | * EnablePort: '<S12>/Enable' |
| 27976 | */ |
| 27977 | if (L4_MABX_B.Operator_eb) { |
| 27978 | /* Reshape: '<S36>/Reshape' incorporates: |
| 27979 | * Constant: '<S36>/Constant' |
| 27980 | */ |
| 27981 | L4_MABX_B.Reshape_a5[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_d[0]; |
| 27982 | L4_MABX_B.Reshape_a5[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_d[1]; |
| 27983 | |
| 27984 | /* UnitDelay: '<S36>/Unit_Delay' */ |
| 27985 | L4_MABX_B.Unit_Delay_g1 = L4_MABX_DW.Unit_Delay_DSTATE_je; |
| 27986 | |
| 27987 | /* UnitDelay: '<S37>/Unit Delay' */ |
| 27988 | L4_MABX_B.UnitDelay_b = L4_MABX_DW.UnitDelay_DSTATE_b; |
| 27989 | |
| 27990 | /* Switch: '<S40>/Switch1' incorporates: |
| 27991 | * Constant: '<S37>/E' |
| 27992 | * Constant: '<S37>/IV' |
| 27993 | * Switch: '<S39>/Switch1' |
| 27994 | */ |
| 27995 | if (L4_MABX_B.Unit_Delay_g1) { |
| 27996 | L4_MABX_B.Switch1_i = L4_MABX_P.IV_Value_e; |
| 27997 | } else { |
| 27998 | if (L4_MABX_P.E_Value_l) { |
| 27999 | /* Sum: '<S37>/Subtract' incorporates: |
| 28000 | * Constant: '<S37>/Constant' |
| 28001 | * Switch: '<S39>/Switch1' |
| 28002 | */ |
| 28003 | q0 = L4_MABX_P.Constant_Value_ae; |
| 28004 | qY = q0 + L4_MABX_B.UnitDelay_b; |
| 28005 | if (qY < q0) { |
| 28006 | qY = MAX_uint32_T; |
| 28007 | } |
| 28008 | |
| 28009 | L4_MABX_B.Subtract_nc = qY; |
| 28010 | |
| 28011 | /* End of Sum: '<S37>/Subtract' */ |
| 28012 | |
| 28013 | /* Switch: '<S39>/Switch1' */ |
| 28014 | L4_MABX_B.Switch1_hm = L4_MABX_B.Subtract_nc; |
| 28015 | } else { |
| 28016 | /* Switch: '<S39>/Switch1' */ |
| 28017 | L4_MABX_B.Switch1_hm = L4_MABX_B.UnitDelay_b; |
| 28018 | } |
| 28019 | |
| 28020 | L4_MABX_B.Switch1_i = L4_MABX_B.Switch1_hm; |
| 28021 | } |
| 28022 | |
| 28023 | /* End of Switch: '<S40>/Switch1' */ |
| 28024 | |
| 28025 | /* Selector: '<S36>/Selector' */ |
| 28026 | L4_MABX_B.Selector_b = L4_MABX_B.Reshape_a5[(int32_T)L4_MABX_B.Switch1_i - 1]; |
| 28027 | |
| 28028 | /* Outputs for Triggered SubSystem: '<S12>/CAN_TYPE1_BOR_M1_C2' incorporates: |
| 28029 | * TriggerPort: '<S35>/Trigger' |
| 28030 | */ |
| 28031 | zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C2_Trig_ZCE == POS_ZCSIG) != |
| 28032 | (int32_T)L4_MABX_B.Selector_b) && |
| 28033 | (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C2_Trig_ZCE != |
| 28034 | UNINITIALIZED_ZCSIG)); |
| 28035 | if (zcEvent) { |
| 28036 | /* S-Function (rti_commonblock): '<S35>/S-Function1' */ |
| 28037 | /* This comment workarounds a code generation problem */ |
| 28038 | |
| 28039 | /* dSPACE RTICAN Bus Off Recovery block */ |
| 28040 | /* ... Perform software-reset of the CAN microcontroller */ |
| 28041 | { |
| 28042 | UInt32 loop_counter, memory; |
| 28043 | loop_counter = 0; |
| 28044 | while ((rtican_type1_tq_error[0][0] = can_tp1_channel_BOff_return |
| 28045 | (can_type1_channel_M1_C2)) == DSMCOM_BUFFER_OVERFLOW) { |
| 28046 | loop_counter++; |
| 28047 | if (loop_counter > MAX_LOOP) { |
| 28048 | memory = rtican_type1_error_level; |
| 28049 | rtican_type1_error_level = 1; |
| 28050 | rtican_type1_tq_err_sig(0, 0); |
| 28051 | rtican_type1_error_level = memory; |
| 28052 | break; |
| 28053 | } |
| 28054 | } |
| 28055 | |
| 28056 | while ((rtican_type1_tq_error[0][0] = can_tp1_channel_all_wakeup |
| 28057 | (can_type1_channel_M1_C2)) == DSMCOM_BUFFER_OVERFLOW) { |
| 28058 | loop_counter++; |
| 28059 | if (loop_counter > MAX_LOOP) { |
| 28060 | memory = rtican_type1_error_level; |
| 28061 | rtican_type1_error_level = 1; |
| 28062 | rtican_type1_tq_err_sig(0, 0); |
| 28063 | rtican_type1_error_level = memory; |
| 28064 | break; |
| 28065 | } |
| 28066 | } |
| 28067 | } |
| 28068 | } |
| 28069 | |
| 28070 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C2_Trig_ZCE = L4_MABX_B.Selector_b; |
| 28071 | |
| 28072 | /* End of Outputs for SubSystem: '<S12>/CAN_TYPE1_BOR_M1_C2' */ |
| 28073 | |
| 28074 | /* RelationalOperator: '<S38>/Operator' */ |
| 28075 | L4_MABX_B.Operator_bsv = (L4_MABX_B.Switch1_i == L4_MABX_ConstB.Width_g); |
| 28076 | } |
| 28077 | |
| 28078 | /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_2' */ |
| 28079 | /* user code (Output function Trailer for TID5) */ |
| 28080 | |
| 28081 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 28082 | /* EventChannel: 0 */ |
| 28083 | if (tid == 0) { |
| 28084 | DSXCP_service(0); |
| 28085 | } |
| 28086 | |
| 28087 | /* If subsystem generates rate grouping Output functions, |
| 28088 | * when tid is used in Output function for one rate, |
| 28089 | * all Output functions include tid as a local variable. |
| 28090 | * As result, some Output functions may have unused tid. |
| 28091 | */ |
| 28092 | UNUSED_PARAMETER(tid); |
| 28093 | } |
| 28094 | |
| 28095 | /* Model update function for TID5 */ |
| 28096 | void L4_MABX_update5(void) /* Sample time: [0.5s, 0.0s] */ |
| 28097 | { |
| 28098 | /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_1' incorporates: |
| 28099 | * EnablePort: '<S11>/Enable' |
| 28100 | */ |
| 28101 | if (L4_MABX_B.Operator_euc) { |
| 28102 | /* Update for UnitDelay: '<S30>/Unit_Delay' */ |
| 28103 | L4_MABX_DW.Unit_Delay_DSTATE_f1 = L4_MABX_B.Operator_f5; |
| 28104 | |
| 28105 | /* Update for UnitDelay: '<S31>/Unit Delay' */ |
| 28106 | L4_MABX_DW.UnitDelay_DSTATE_j1 = L4_MABX_B.Switch1_o; |
| 28107 | } |
| 28108 | |
| 28109 | /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_1' */ |
| 28110 | |
| 28111 | /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_5' incorporates: |
| 28112 | * EnablePort: '<S15>/Enable' |
| 28113 | */ |
| 28114 | if (L4_MABX_B.Operator_msz) { |
| 28115 | /* Update for UnitDelay: '<S54>/Unit_Delay' */ |
| 28116 | L4_MABX_DW.Unit_Delay_DSTATE_i5 = L4_MABX_B.Operator_ho; |
| 28117 | |
| 28118 | /* Update for UnitDelay: '<S55>/Unit Delay' */ |
| 28119 | L4_MABX_DW.UnitDelay_DSTATE_p = L4_MABX_B.Switch1_k; |
| 28120 | } |
| 28121 | |
| 28122 | /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_5' */ |
| 28123 | |
| 28124 | /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_6' incorporates: |
| 28125 | * EnablePort: '<S16>/Enable' |
| 28126 | */ |
| 28127 | if (L4_MABX_B.Operator_fv) { |
| 28128 | /* Update for UnitDelay: '<S60>/Unit_Delay' */ |
| 28129 | L4_MABX_DW.Unit_Delay_DSTATE_l5 = L4_MABX_B.Operator_bg; |
| 28130 | |
| 28131 | /* Update for UnitDelay: '<S61>/Unit Delay' */ |
| 28132 | L4_MABX_DW.UnitDelay_DSTATE_dr = L4_MABX_B.Switch1_h; |
| 28133 | } |
| 28134 | |
| 28135 | /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_6' */ |
| 28136 | |
| 28137 | /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_3' incorporates: |
| 28138 | * EnablePort: '<S13>/Enable' |
| 28139 | */ |
| 28140 | if (L4_MABX_B.Operator_bsh) { |
| 28141 | /* Update for UnitDelay: '<S42>/Unit_Delay' */ |
| 28142 | L4_MABX_DW.Unit_Delay_DSTATE_h41 = L4_MABX_B.Operator_dh; |
| 28143 | |
| 28144 | /* Update for UnitDelay: '<S43>/Unit Delay' */ |
| 28145 | L4_MABX_DW.UnitDelay_DSTATE_dr4 = L4_MABX_B.Switch1_k4; |
| 28146 | } |
| 28147 | |
| 28148 | /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_3' */ |
| 28149 | |
| 28150 | /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_4' incorporates: |
| 28151 | * EnablePort: '<S14>/Enable' |
| 28152 | */ |
| 28153 | if (L4_MABX_B.Operator_bw) { |
| 28154 | /* Update for UnitDelay: '<S48>/Unit_Delay' */ |
| 28155 | L4_MABX_DW.Unit_Delay_DSTATE_mq = L4_MABX_B.Operator_ou; |
| 28156 | |
| 28157 | /* Update for UnitDelay: '<S49>/Unit Delay' */ |
| 28158 | L4_MABX_DW.UnitDelay_DSTATE_h = L4_MABX_B.Switch1_ex; |
| 28159 | } |
| 28160 | |
| 28161 | /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_4' */ |
| 28162 | |
| 28163 | /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_2' incorporates: |
| 28164 | * EnablePort: '<S12>/Enable' |
| 28165 | */ |
| 28166 | if (L4_MABX_B.Operator_eb) { |
| 28167 | /* Update for UnitDelay: '<S36>/Unit_Delay' */ |
| 28168 | L4_MABX_DW.Unit_Delay_DSTATE_je = L4_MABX_B.Operator_bsv; |
| 28169 | |
| 28170 | /* Update for UnitDelay: '<S37>/Unit Delay' */ |
| 28171 | L4_MABX_DW.UnitDelay_DSTATE_b = L4_MABX_B.Switch1_i; |
| 28172 | } |
| 28173 | |
| 28174 | /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_2' */ |
| 28175 | } |
| 28176 | |
| 28177 | /* Model output function for TID6 */ |
| 28178 | void L4_MABX_output6(void) /* Sample time: [1.0s, 0.0s] */ |
| 28179 | { |
| 28180 | int_T tid = 6; |
| 28181 | |
| 28182 | /* Outputs for Atomic SubSystem: '<S855>/CAN_TX_1000ms' */ |
| 28183 | |
| 28184 | /* DataTypeConversion: '<S867>/Data Type Conversion' incorporates: |
| 28185 | * Constant: '<S858>/Constant2' |
| 28186 | */ |
| 28187 | L4_MABX_B.DataTypeConversion_kz = (uint8_T)L4_MABX_P.Constant2_Value_k; |
| 28188 | |
| 28189 | /* S-Function (sfix_bitop): '<S872>/Operator' */ |
| 28190 | L4_MABX_B.Operator_jo = (uint8_T)(L4_MABX_B.DataTypeConversion_kz & |
| 28191 | L4_MABX_P.Operator_BitMask); |
| 28192 | |
| 28193 | /* DataTypeConversion: '<S872>/DataType' */ |
| 28194 | L4_MABX_B.DataType_o5 = L4_MABX_B.Operator_jo; |
| 28195 | |
| 28196 | /* ArithShift: '<S867>/Shift_Arithmetic 2' */ |
| 28197 | L4_MABX_B.Shift_Arithmetic2_a = ldexp(L4_MABX_B.DataType_o5, (-3)); |
| 28198 | |
| 28199 | /* DataTypeConversion: '<S867>/Data Type Conversion5' */ |
| 28200 | L4_MABX_B.DataTypeConversion5_op = (L4_MABX_B.Shift_Arithmetic2_a != 0.0); |
| 28201 | |
| 28202 | /* Outputs for Enabled SubSystem: '<S875>/AIR1' incorporates: |
| 28203 | * EnablePort: '<S876>/Enable' |
| 28204 | */ |
| 28205 | if (L4_MABX_B.DataTypeConversion5_op) { |
| 28206 | /* S-Function (rti_commonblock): '<S876>/S-Function1' */ |
| 28207 | /* This comment workarounds a code generation problem */ |
| 28208 | |
| 28209 | /* dSPACE RTICAN TX Message Block: "AIR1" Id:419343921 */ |
| 28210 | { |
| 28211 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 28212 | |
| 28213 | Float32 delayTime = 0.0; |
| 28214 | |
| 28215 | /* ... Read status and timestamp info (previous message) */ |
| 28216 | can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]); |
| 28217 | |
| 28218 | /* Convert timestamp */ |
| 28219 | if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->processed) { |
| 28220 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->timestamp = |
| 28221 | rtk_dsts_time_to_simtime_convert |
| 28222 | (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->timestamp); |
| 28223 | } |
| 28224 | |
| 28225 | /* Messages with timestamp zero have been received in pause/stop state |
| 28226 | and must not be handled. |
| 28227 | */ |
| 28228 | if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->timestamp > 0.0) { |
| 28229 | L4_MABX_B.SFunction1_o1_bs = (real_T) |
| 28230 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->processed; |
| 28231 | L4_MABX_B.SFunction1_o2_ad = (real_T) |
| 28232 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->timestamp; |
| 28233 | L4_MABX_B.SFunction1_o3_dz = (real_T) |
| 28234 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->deltatime; |
| 28235 | L4_MABX_B.SFunction1_o4_hw = (real_T) |
| 28236 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->delaytime; |
| 28237 | } |
| 28238 | |
| 28239 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 28240 | { |
| 28241 | rtican_Signal_t CAN_Sgn; |
| 28242 | |
| 28243 | /* ...... "PneumaticSupplyPress" (0|8, standard signal, unsigned int, little endian) */ |
| 28244 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28245 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.PneumaticSupplyPress - ( 0 ) |
| 28246 | ) / 8 + 0.5); |
| 28247 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 28248 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 28249 | |
| 28250 | /* ...... "ParkingAnd_orTrailerAirPress" (8|8, standard signal, unsigned int, little endian) */ |
| 28251 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28252 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkingAnd_orTrailerAirPress |
| 28253 | - ( 0 ) ) / 8 + 0.5); |
| 28254 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 28255 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 28256 | |
| 28257 | /* ...... "ServiceBrakeCircuit1AirPress" (16|8, standard signal, unsigned int, little endian) */ |
| 28258 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28259 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ServiceBrakeCircuit1AirPress |
| 28260 | - ( 0 ) ) / 8 + 0.5); |
| 28261 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 28262 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 28263 | |
| 28264 | /* ...... "ServiceBrakeCircuit2AirPress" (24|8, standard signal, unsigned int, little endian) */ |
| 28265 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28266 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ServiceBrakeCircuit2AirPress |
| 28267 | - ( 0 ) ) / 8 + 0.5); |
| 28268 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 28269 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 28270 | |
| 28271 | /* ...... "AuxEquipmentSupplyPress" (32|8, standard signal, unsigned int, little endian) */ |
| 28272 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28273 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AuxEquipmentSupplyPress - |
| 28274 | ( 0 ) ) / 8 + 0.5); |
| 28275 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 28276 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 28277 | |
| 28278 | /* ...... "AirSuspensionSupplyPress" (40|8, standard signal, unsigned int, little endian) */ |
| 28279 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28280 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AirSuspensionSupplyPress - ( |
| 28281 | 0 ) ) / 8 + 0.5); |
| 28282 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 28283 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 28284 | |
| 28285 | /* ...... "AirCompressorStatus" (48|2, standard signal, unsigned int, little endian) */ |
| 28286 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28287 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AirCompressorStatus ) + 0.5); |
| 28288 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 28289 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 28290 | |
| 28291 | /* ...... "PowertrainCircuitAirSupplyPress" (56|8, standard signal, unsigned int, little endian) */ |
| 28292 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28293 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 28294 | (( L4_MABX_B.PowertrainCircuitAirSupplyPress - ( 0 ) ) / 8 + 0.5); |
| 28295 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 28296 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 28297 | } |
| 28298 | |
| 28299 | /* mask unused bits with '1' */ |
| 28300 | CAN_Msg[6] |= 0xFC; |
| 28301 | |
| 28302 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 28303 | can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31], 8, |
| 28304 | &(CAN_Msg[0]), delayTime); |
| 28305 | } |
| 28306 | } |
| 28307 | |
| 28308 | /* End of Outputs for SubSystem: '<S875>/AIR1' */ |
| 28309 | |
| 28310 | /* S-Function (sfix_bitop): '<S869>/Operator' */ |
| 28311 | L4_MABX_B.Operator_ed = (uint8_T)(L4_MABX_B.DataTypeConversion_kz & |
| 28312 | L4_MABX_P.Operator_BitMask_d); |
| 28313 | |
| 28314 | /* DataTypeConversion: '<S869>/DataType' */ |
| 28315 | L4_MABX_B.DataType_kt = L4_MABX_B.Operator_ed; |
| 28316 | |
| 28317 | /* S-Function (sfix_bitop): '<S870>/Operator' */ |
| 28318 | L4_MABX_B.Operator_g1 = (uint8_T)(L4_MABX_B.DataTypeConversion_kz & |
| 28319 | L4_MABX_P.Operator_BitMask_o); |
| 28320 | |
| 28321 | /* DataTypeConversion: '<S870>/DataType' */ |
| 28322 | L4_MABX_B.DataType_eg = L4_MABX_B.Operator_g1; |
| 28323 | |
| 28324 | /* S-Function (sfix_bitop): '<S871>/Operator' */ |
| 28325 | L4_MABX_B.Operator_ka = (uint8_T)(L4_MABX_B.DataTypeConversion_kz & |
| 28326 | L4_MABX_P.Operator_BitMask_c); |
| 28327 | |
| 28328 | /* DataTypeConversion: '<S871>/DataType' */ |
| 28329 | L4_MABX_B.DataType_d5 = L4_MABX_B.Operator_ka; |
| 28330 | |
| 28331 | /* S-Function (sfix_bitop): '<S873>/Operator' */ |
| 28332 | L4_MABX_B.Operator_hp = (uint8_T)(L4_MABX_B.DataTypeConversion_kz & |
| 28333 | L4_MABX_P.Operator_BitMask_dc); |
| 28334 | |
| 28335 | /* DataTypeConversion: '<S873>/DataType' */ |
| 28336 | L4_MABX_B.DataType_mb = L4_MABX_B.Operator_hp; |
| 28337 | |
| 28338 | /* S-Function (sfix_bitop): '<S874>/Operator' */ |
| 28339 | L4_MABX_B.Operator_oo = (uint8_T)(L4_MABX_B.DataTypeConversion_kz & |
| 28340 | L4_MABX_P.Operator_BitMask_b); |
| 28341 | |
| 28342 | /* DataTypeConversion: '<S874>/DataType' */ |
| 28343 | L4_MABX_B.DataType_iw = L4_MABX_B.Operator_oo; |
| 28344 | |
| 28345 | /* DataTypeConversion: '<S867>/Data Type Conversion2' */ |
| 28346 | L4_MABX_B.DataTypeConversion2_gf = (L4_MABX_B.DataType_kt != 0); |
| 28347 | |
| 28348 | /* ArithShift: '<S867>/Shift_Arithmetic ' */ |
| 28349 | L4_MABX_B.Shift_Arithmetic_l = ldexp(L4_MABX_B.DataType_eg, (-1)); |
| 28350 | |
| 28351 | /* DataTypeConversion: '<S867>/Data Type Conversion3' */ |
| 28352 | L4_MABX_B.DataTypeConversion3_do = (L4_MABX_B.Shift_Arithmetic_l != 0.0); |
| 28353 | |
| 28354 | /* ArithShift: '<S867>/Shift_Arithmetic 1' */ |
| 28355 | L4_MABX_B.Shift_Arithmetic1_d = ldexp(L4_MABX_B.DataType_d5, (-2)); |
| 28356 | |
| 28357 | /* DataTypeConversion: '<S867>/Data Type Conversion4' */ |
| 28358 | L4_MABX_B.DataTypeConversion4_ma = (L4_MABX_B.Shift_Arithmetic1_d != 0.0); |
| 28359 | |
| 28360 | /* ArithShift: '<S867>/Shift_Arithmetic 3' */ |
| 28361 | L4_MABX_B.Shift_Arithmetic3_b = ldexp(L4_MABX_B.DataType_mb, (-4)); |
| 28362 | |
| 28363 | /* DataTypeConversion: '<S867>/Data Type Conversion6' */ |
| 28364 | L4_MABX_B.DataTypeConversion6_gt = (L4_MABX_B.Shift_Arithmetic3_b != 0.0); |
| 28365 | |
| 28366 | /* ArithShift: '<S867>/Shift_Arithmetic 4' */ |
| 28367 | L4_MABX_B.Shift_Arithmetic4_m = ldexp(L4_MABX_B.DataType_iw, (-5)); |
| 28368 | |
| 28369 | /* DataTypeConversion: '<S867>/Data Type Conversion7' */ |
| 28370 | L4_MABX_B.DataTypeConversion7_p2 = (L4_MABX_B.Shift_Arithmetic4_m != 0.0); |
| 28371 | |
| 28372 | /* DataTypeConversion: '<S868>/Data Type Conversion' incorporates: |
| 28373 | * Constant: '<S858>/Constant1' |
| 28374 | */ |
| 28375 | L4_MABX_B.DataTypeConversion_bk = (uint8_T)L4_MABX_P.Constant1_Value_og; |
| 28376 | |
| 28377 | /* S-Function (sfix_bitop): '<S880>/Operator' */ |
| 28378 | L4_MABX_B.Operator_pz = (uint8_T)(L4_MABX_B.DataTypeConversion_bk & |
| 28379 | L4_MABX_P.Operator_BitMask_ou); |
| 28380 | |
| 28381 | /* DataTypeConversion: '<S880>/DataType' */ |
| 28382 | L4_MABX_B.DataType_ba = L4_MABX_B.Operator_pz; |
| 28383 | |
| 28384 | /* ArithShift: '<S868>/Shift_Arithmetic 2' */ |
| 28385 | L4_MABX_B.Shift_Arithmetic2_j = ldexp(L4_MABX_B.DataType_ba, (-3)); |
| 28386 | |
| 28387 | /* DataTypeConversion: '<S868>/Data Type Conversion5' */ |
| 28388 | L4_MABX_B.DataTypeConversion5_pl = (L4_MABX_B.Shift_Arithmetic2_j != 0.0); |
| 28389 | |
| 28390 | /* Outputs for Enabled SubSystem: '<S883>/AMB' incorporates: |
| 28391 | * EnablePort: '<S884>/Enable' |
| 28392 | */ |
| 28393 | if (L4_MABX_B.DataTypeConversion5_pl) { |
| 28394 | /* S-Function (rti_commonblock): '<S884>/S-Function1' */ |
| 28395 | /* This comment workarounds a code generation problem */ |
| 28396 | |
| 28397 | /* dSPACE RTICAN TX Message Block: "AMB" Id:419362048 */ |
| 28398 | { |
| 28399 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 28400 | |
| 28401 | Float32 delayTime = 0.0; |
| 28402 | |
| 28403 | /* ... Read status and timestamp info (previous message) */ |
| 28404 | can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]); |
| 28405 | |
| 28406 | /* Convert timestamp */ |
| 28407 | if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->processed) { |
| 28408 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->timestamp = |
| 28409 | rtk_dsts_time_to_simtime_convert |
| 28410 | (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->timestamp); |
| 28411 | } |
| 28412 | |
| 28413 | /* Messages with timestamp zero have been received in pause/stop state |
| 28414 | and must not be handled. |
| 28415 | */ |
| 28416 | if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->timestamp > 0.0) { |
| 28417 | L4_MABX_B.SFunction1_o1_lt = (real_T) |
| 28418 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->processed; |
| 28419 | L4_MABX_B.SFunction1_o2_n = (real_T) |
| 28420 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->timestamp; |
| 28421 | L4_MABX_B.SFunction1_o3_ea = (real_T) |
| 28422 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->deltatime; |
| 28423 | L4_MABX_B.SFunction1_o4_d0 = (real_T) |
| 28424 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->delaytime; |
| 28425 | } |
| 28426 | |
| 28427 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 28428 | { |
| 28429 | rtican_Signal_t CAN_Sgn; |
| 28430 | |
| 28431 | /* ...... "BarometricPress" (0|8, standard signal, unsigned int, little endian) */ |
| 28432 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28433 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.BarometricPress_p - ( 0 ) ) / |
| 28434 | 0.5 + 0.5); |
| 28435 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 28436 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 28437 | |
| 28438 | /* ...... "CabInteriorTemp" (8|16, standard signal, unsigned int, little endian) */ |
| 28439 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28440 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CabInteriorTemp - ( -273 ) ) |
| 28441 | / 0.03125 + 0.5); |
| 28442 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 28443 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 28444 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte1; |
| 28445 | |
| 28446 | /* ...... "AmbientAirTemp" (24|16, standard signal, unsigned int, little endian) */ |
| 28447 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28448 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AmbientAirTemp_a - ( -273 ) ) |
| 28449 | / 0.03125 + 0.5); |
| 28450 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 28451 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 28452 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte1; |
| 28453 | |
| 28454 | /* ...... "EngAirIntakeTemp" (40|8, standard signal, unsigned int, little endian) */ |
| 28455 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28456 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.EngAirIntakeTemp - ( -40 ) + |
| 28457 | 0.5); |
| 28458 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 28459 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 28460 | |
| 28461 | /* ...... "RoadSurfaceTemp" (48|16, standard signal, unsigned int, little endian) */ |
| 28462 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28463 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.RoadSurfaceTemp - ( -273 ) ) |
| 28464 | / 0.03125 + 0.5); |
| 28465 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 28466 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 28467 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte1; |
| 28468 | } |
| 28469 | |
| 28470 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 28471 | can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500], 8, |
| 28472 | &(CAN_Msg[0]), delayTime); |
| 28473 | } |
| 28474 | } |
| 28475 | |
| 28476 | /* End of Outputs for SubSystem: '<S883>/AMB' */ |
| 28477 | |
| 28478 | /* S-Function (sfix_bitop): '<S877>/Operator' */ |
| 28479 | L4_MABX_B.Operator_osm = (uint8_T)(L4_MABX_B.DataTypeConversion_bk & |
| 28480 | L4_MABX_P.Operator_BitMask_h); |
| 28481 | |
| 28482 | /* DataTypeConversion: '<S877>/DataType' */ |
| 28483 | L4_MABX_B.DataType_lb = L4_MABX_B.Operator_osm; |
| 28484 | |
| 28485 | /* S-Function (sfix_bitop): '<S878>/Operator' */ |
| 28486 | L4_MABX_B.Operator_he = (uint8_T)(L4_MABX_B.DataTypeConversion_bk & |
| 28487 | L4_MABX_P.Operator_BitMask_k); |
| 28488 | |
| 28489 | /* DataTypeConversion: '<S878>/DataType' */ |
| 28490 | L4_MABX_B.DataType_il = L4_MABX_B.Operator_he; |
| 28491 | |
| 28492 | /* S-Function (sfix_bitop): '<S879>/Operator' */ |
| 28493 | L4_MABX_B.Operator_nu = (uint8_T)(L4_MABX_B.DataTypeConversion_bk & |
| 28494 | L4_MABX_P.Operator_BitMask_e); |
| 28495 | |
| 28496 | /* DataTypeConversion: '<S879>/DataType' */ |
| 28497 | L4_MABX_B.DataType_jc = L4_MABX_B.Operator_nu; |
| 28498 | |
| 28499 | /* S-Function (sfix_bitop): '<S881>/Operator' */ |
| 28500 | L4_MABX_B.Operator_gl = (uint8_T)(L4_MABX_B.DataTypeConversion_bk & |
| 28501 | L4_MABX_P.Operator_BitMask_og); |
| 28502 | |
| 28503 | /* DataTypeConversion: '<S881>/DataType' */ |
| 28504 | L4_MABX_B.DataType_gq = L4_MABX_B.Operator_gl; |
| 28505 | |
| 28506 | /* S-Function (sfix_bitop): '<S882>/Operator' */ |
| 28507 | L4_MABX_B.Operator_kk = (uint8_T)(L4_MABX_B.DataTypeConversion_bk & |
| 28508 | L4_MABX_P.Operator_BitMask_g); |
| 28509 | |
| 28510 | /* DataTypeConversion: '<S882>/DataType' */ |
| 28511 | L4_MABX_B.DataType_jn = L4_MABX_B.Operator_kk; |
| 28512 | |
| 28513 | /* DataTypeConversion: '<S868>/Data Type Conversion2' */ |
| 28514 | L4_MABX_B.DataTypeConversion2_pt = (L4_MABX_B.DataType_lb != 0); |
| 28515 | |
| 28516 | /* ArithShift: '<S868>/Shift_Arithmetic ' */ |
| 28517 | L4_MABX_B.Shift_Arithmetic_o = ldexp(L4_MABX_B.DataType_il, (-1)); |
| 28518 | |
| 28519 | /* DataTypeConversion: '<S868>/Data Type Conversion3' */ |
| 28520 | L4_MABX_B.DataTypeConversion3_np = (L4_MABX_B.Shift_Arithmetic_o != 0.0); |
| 28521 | |
| 28522 | /* ArithShift: '<S868>/Shift_Arithmetic 1' */ |
| 28523 | L4_MABX_B.Shift_Arithmetic1_dz = ldexp(L4_MABX_B.DataType_jc, (-2)); |
| 28524 | |
| 28525 | /* DataTypeConversion: '<S868>/Data Type Conversion4' */ |
| 28526 | L4_MABX_B.DataTypeConversion4_ae = (L4_MABX_B.Shift_Arithmetic1_dz != 0.0); |
| 28527 | |
| 28528 | /* ArithShift: '<S868>/Shift_Arithmetic 3' */ |
| 28529 | L4_MABX_B.Shift_Arithmetic3_an = ldexp(L4_MABX_B.DataType_gq, (-4)); |
| 28530 | |
| 28531 | /* DataTypeConversion: '<S868>/Data Type Conversion6' */ |
| 28532 | L4_MABX_B.DataTypeConversion6_dh = (L4_MABX_B.Shift_Arithmetic3_an != 0.0); |
| 28533 | |
| 28534 | /* ArithShift: '<S868>/Shift_Arithmetic 4' */ |
| 28535 | L4_MABX_B.Shift_Arithmetic4_n = ldexp(L4_MABX_B.DataType_jn, (-5)); |
| 28536 | |
| 28537 | /* DataTypeConversion: '<S868>/Data Type Conversion7' */ |
| 28538 | L4_MABX_B.DataTypeConversion7_c0 = (L4_MABX_B.Shift_Arithmetic4_n != 0.0); |
| 28539 | |
| 28540 | /* End of Outputs for SubSystem: '<S855>/CAN_TX_1000ms' */ |
| 28541 | /* user code (Output function Trailer for TID6) */ |
| 28542 | |
| 28543 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 28544 | /* EventChannel: 0 */ |
| 28545 | if (tid == 0) { |
| 28546 | DSXCP_service(0); |
| 28547 | } |
| 28548 | |
| 28549 | /* If subsystem generates rate grouping Output functions, |
| 28550 | * when tid is used in Output function for one rate, |
| 28551 | * all Output functions include tid as a local variable. |
| 28552 | * As result, some Output functions may have unused tid. |
| 28553 | */ |
| 28554 | UNUSED_PARAMETER(tid); |
| 28555 | } |
| 28556 | |
| 28557 | /* Model update function for TID6 */ |
| 28558 | void L4_MABX_update6(void) /* Sample time: [1.0s, 0.0s] */ |
| 28559 | { |
| 28560 | /* (no update code required) */ |
| 28561 | } |
| 28562 | |
| 28563 | /* Model output function for TID7 */ |
| 28564 | void L4_MABX_output7(void) /* Sample time: [5.0s, 0.0s] */ |
| 28565 | { |
| 28566 | int_T tid = 7; |
| 28567 | int32_T i; |
| 28568 | uint16_T tmp; |
| 28569 | uint32_T q0; |
| 28570 | uint32_T qY; |
| 28571 | |
| 28572 | /* Outputs for Atomic SubSystem: '<S855>/CAN_TX_5000ms' */ |
| 28573 | |
| 28574 | /* DataTypeConversion: '<S1046>/Data Type Conversion6' incorporates: |
| 28575 | * Constant: '<S1046>/Enable_TX_RequestDiagMsgFromREAX' |
| 28576 | */ |
| 28577 | L4_MABX_B.DataTypeConversion6_k = L4_MABX_P.Enable_TX_RequestDiagMsgFromREA; |
| 28578 | |
| 28579 | /* Logic: '<S1050>/Operator' */ |
| 28580 | L4_MABX_B.Operator_fc3 = (L4_MABX_B.DataTypeConversion6_k && |
| 28581 | L4_MABX_B.TmpRTBAtOperatorInport2); |
| 28582 | |
| 28583 | /* DataTypeConversion: '<S1050>/DataType' */ |
| 28584 | L4_MABX_B.DataType_mo = L4_MABX_B.Operator_fc3; |
| 28585 | |
| 28586 | /* Reshape: '<S1055>/Reshape' incorporates: |
| 28587 | * Constant: '<S1055>/Constant' |
| 28588 | */ |
| 28589 | for (i = 0; i < 8; i++) { |
| 28590 | L4_MABX_B.Reshape[i] = L4_MABX_P.Repeating_Sequence_Stair_OutVal[i]; |
| 28591 | } |
| 28592 | |
| 28593 | /* End of Reshape: '<S1055>/Reshape' */ |
| 28594 | |
| 28595 | /* UnitDelay: '<S1055>/Unit_Delay' */ |
| 28596 | L4_MABX_B.Unit_Delay_bi = L4_MABX_DW.Unit_Delay_DSTATE_a; |
| 28597 | |
| 28598 | /* UnitDelay: '<S1056>/Unit Delay' */ |
| 28599 | L4_MABX_B.UnitDelay_i = L4_MABX_DW.UnitDelay_DSTATE_a; |
| 28600 | |
| 28601 | /* Switch: '<S1059>/Switch1' incorporates: |
| 28602 | * Constant: '<S1056>/E' |
| 28603 | * Constant: '<S1056>/IV' |
| 28604 | * Switch: '<S1058>/Switch1' |
| 28605 | */ |
| 28606 | if (L4_MABX_B.Unit_Delay_bi) { |
| 28607 | L4_MABX_B.Switch1_p2 = L4_MABX_P.IV_Value_i; |
| 28608 | } else { |
| 28609 | if (L4_MABX_P.E_Value_g) { |
| 28610 | /* Sum: '<S1056>/Subtract' incorporates: |
| 28611 | * Constant: '<S1056>/Constant' |
| 28612 | * Switch: '<S1058>/Switch1' |
| 28613 | */ |
| 28614 | q0 = L4_MABX_P.Constant_Value_h4; |
| 28615 | qY = q0 + L4_MABX_B.UnitDelay_i; |
| 28616 | if (qY < q0) { |
| 28617 | qY = MAX_uint32_T; |
| 28618 | } |
| 28619 | |
| 28620 | L4_MABX_B.Subtract_en = qY; |
| 28621 | |
| 28622 | /* End of Sum: '<S1056>/Subtract' */ |
| 28623 | |
| 28624 | /* Switch: '<S1058>/Switch1' */ |
| 28625 | L4_MABX_B.Switch1_md = L4_MABX_B.Subtract_en; |
| 28626 | } else { |
| 28627 | /* Switch: '<S1058>/Switch1' */ |
| 28628 | L4_MABX_B.Switch1_md = L4_MABX_B.UnitDelay_i; |
| 28629 | } |
| 28630 | |
| 28631 | L4_MABX_B.Switch1_p2 = L4_MABX_B.Switch1_md; |
| 28632 | } |
| 28633 | |
| 28634 | /* End of Switch: '<S1059>/Switch1' */ |
| 28635 | |
| 28636 | /* Selector: '<S1055>/Selector' */ |
| 28637 | L4_MABX_B.Selector = L4_MABX_B.Reshape[(int32_T)L4_MABX_B.Switch1_p2 - 1]; |
| 28638 | |
| 28639 | /* DataTypeConversion: '<S1047>/Data Type Conversion' */ |
| 28640 | L4_MABX_B.DataTypeConversion_gb = L4_MABX_B.Selector; |
| 28641 | |
| 28642 | /* S-Function (sfix_bitop): '<S1052>/Operator' */ |
| 28643 | L4_MABX_B.Operator = L4_MABX_B.DataTypeConversion_gb & |
| 28644 | L4_MABX_P.Operator_BitMask_ge; |
| 28645 | |
| 28646 | /* DataTypeConversion: '<S1052>/DataType' */ |
| 28647 | q0 = L4_MABX_B.Operator; |
| 28648 | if (q0 > 255U) { |
| 28649 | q0 = 255U; |
| 28650 | } |
| 28651 | |
| 28652 | L4_MABX_B.DataType_hg = (uint8_T)q0; |
| 28653 | |
| 28654 | /* End of DataTypeConversion: '<S1052>/DataType' */ |
| 28655 | |
| 28656 | /* DataTypeConversion: '<S1047>/Data Type Conversion3' */ |
| 28657 | L4_MABX_B.DataTypeConversion3_ga = L4_MABX_B.DataType_hg; |
| 28658 | |
| 28659 | /* DataTypeConversion: '<S1049>/Data Type Conversion' */ |
| 28660 | L4_MABX_B.DataTypeConversion_l = L4_MABX_B.DataTypeConversion3_ga; |
| 28661 | |
| 28662 | /* S-Function (sfix_bitop): '<S1053>/Operator' */ |
| 28663 | L4_MABX_B.Operator_b = L4_MABX_B.DataTypeConversion_gb & |
| 28664 | L4_MABX_P.Operator_BitMask_eq; |
| 28665 | |
| 28666 | /* DataTypeConversion: '<S1053>/DataType' */ |
| 28667 | q0 = L4_MABX_B.Operator_b; |
| 28668 | if (q0 > 65535U) { |
| 28669 | q0 = 65535U; |
| 28670 | } |
| 28671 | |
| 28672 | L4_MABX_B.DataType_hj = (uint16_T)q0; |
| 28673 | |
| 28674 | /* End of DataTypeConversion: '<S1053>/DataType' */ |
| 28675 | |
| 28676 | /* ArithShift: '<S1047>/Shift_Arithmetic ' */ |
| 28677 | L4_MABX_B.Shift_Arithmetic_b = (uint16_T)((uint32_T)L4_MABX_B.DataType_hj >> 8); |
| 28678 | |
| 28679 | /* DataTypeConversion: '<S1047>/Data Type Conversion1' */ |
| 28680 | tmp = L4_MABX_B.Shift_Arithmetic_b; |
| 28681 | if (tmp > 255) { |
| 28682 | tmp = 255U; |
| 28683 | } |
| 28684 | |
| 28685 | L4_MABX_B.DataTypeConversion1_eu = (uint8_T)tmp; |
| 28686 | |
| 28687 | /* End of DataTypeConversion: '<S1047>/Data Type Conversion1' */ |
| 28688 | |
| 28689 | /* DataTypeConversion: '<S1049>/Data Type Conversion1' */ |
| 28690 | L4_MABX_B.DataTypeConversion1_h = L4_MABX_B.DataTypeConversion1_eu; |
| 28691 | |
| 28692 | /* S-Function (sfix_bitop): '<S1054>/Operator' */ |
| 28693 | L4_MABX_B.Operator_d = L4_MABX_B.DataTypeConversion_gb & |
| 28694 | L4_MABX_P.Operator_BitMask_ms; |
| 28695 | |
| 28696 | /* DataTypeConversion: '<S1054>/DataType' */ |
| 28697 | L4_MABX_B.DataType_mh = L4_MABX_B.Operator_d; |
| 28698 | |
| 28699 | /* ArithShift: '<S1047>/Shift_Arithmetic 1' */ |
| 28700 | L4_MABX_B.Shift_Arithmetic1_j3 = L4_MABX_B.DataType_mh >> 16; |
| 28701 | |
| 28702 | /* DataTypeConversion: '<S1047>/Data Type Conversion2' */ |
| 28703 | q0 = L4_MABX_B.Shift_Arithmetic1_j3; |
| 28704 | if (q0 > 255U) { |
| 28705 | q0 = 255U; |
| 28706 | } |
| 28707 | |
| 28708 | L4_MABX_B.DataTypeConversion2_g5 = (uint8_T)q0; |
| 28709 | |
| 28710 | /* End of DataTypeConversion: '<S1047>/Data Type Conversion2' */ |
| 28711 | |
| 28712 | /* DataTypeConversion: '<S1049>/Data Type Conversion2' */ |
| 28713 | L4_MABX_B.DataTypeConversion2_bv = L4_MABX_B.DataTypeConversion2_g5; |
| 28714 | |
| 28715 | /* Outputs for Enabled SubSystem: '<S1049>/RQST_13_E4' incorporates: |
| 28716 | * EnablePort: '<S1051>/Enable' |
| 28717 | */ |
| 28718 | if (L4_MABX_B.DataType_mo) { |
| 28719 | /* S-Function (rti_commonblock): '<S1051>/S-Function1' */ |
| 28720 | /* This comment workarounds a code generation problem */ |
| 28721 | |
| 28722 | /* dSPACE RTICAN TX Message Block: "RQST_13_E4" Id:417993700 */ |
| 28723 | { |
| 28724 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 28725 | |
| 28726 | Float32 delayTime = 0.0; |
| 28727 | |
| 28728 | /* ... Read status and timestamp info (previous message) */ |
| 28729 | can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]); |
| 28730 | |
| 28731 | /* Convert timestamp */ |
| 28732 | if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->processed) { |
| 28733 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->timestamp = |
| 28734 | rtk_dsts_time_to_simtime_convert |
| 28735 | (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->timestamp); |
| 28736 | } |
| 28737 | |
| 28738 | /* Messages with timestamp zero have been received in pause/stop state |
| 28739 | and must not be handled. |
| 28740 | */ |
| 28741 | if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->timestamp > 0.0) { |
| 28742 | L4_MABX_B.SFunction1_o1_p = (real_T) |
| 28743 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->processed; |
| 28744 | L4_MABX_B.SFunction1_o2_k = (real_T) |
| 28745 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->timestamp; |
| 28746 | L4_MABX_B.SFunction1_o3_i = (real_T) |
| 28747 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->deltatime; |
| 28748 | L4_MABX_B.SFunction1_o4_e = (real_T) |
| 28749 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->delaytime; |
| 28750 | } |
| 28751 | |
| 28752 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 28753 | { |
| 28754 | rtican_Signal_t CAN_Sgn; |
| 28755 | |
| 28756 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 28757 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28758 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_l ) + 0.5); |
| 28759 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 28760 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 28761 | |
| 28762 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 28763 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28764 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_h ) + |
| 28765 | 0.5); |
| 28766 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 28767 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 28768 | |
| 28769 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 28770 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28771 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion2_bv ) + |
| 28772 | 0.5); |
| 28773 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 28774 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 28775 | } |
| 28776 | |
| 28777 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 28778 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4], 8, |
| 28779 | &(CAN_Msg[0]), delayTime); |
| 28780 | } |
| 28781 | } |
| 28782 | |
| 28783 | /* End of Outputs for SubSystem: '<S1049>/RQST_13_E4' */ |
| 28784 | |
| 28785 | /* RelationalOperator: '<S1057>/Operator' */ |
| 28786 | L4_MABX_B.Operator_ee = (L4_MABX_B.Switch1_p2 == L4_MABX_B.Width); |
| 28787 | |
| 28788 | /* End of Outputs for SubSystem: '<S855>/CAN_TX_5000ms' */ |
| 28789 | /* user code (Output function Trailer for TID7) */ |
| 28790 | |
| 28791 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 28792 | /* EventChannel: 0 */ |
| 28793 | if (tid == 0) { |
| 28794 | DSXCP_service(0); |
| 28795 | } |
| 28796 | |
| 28797 | /* If subsystem generates rate grouping Output functions, |
| 28798 | * when tid is used in Output function for one rate, |
| 28799 | * all Output functions include tid as a local variable. |
| 28800 | * As result, some Output functions may have unused tid. |
| 28801 | */ |
| 28802 | UNUSED_PARAMETER(tid); |
| 28803 | } |
| 28804 | |
| 28805 | /* Model update function for TID7 */ |
| 28806 | void L4_MABX_update7(void) /* Sample time: [5.0s, 0.0s] */ |
| 28807 | { |
| 28808 | /* Update for Atomic SubSystem: '<S855>/CAN_TX_5000ms' */ |
| 28809 | |
| 28810 | /* Update for UnitDelay: '<S1055>/Unit_Delay' */ |
| 28811 | L4_MABX_DW.Unit_Delay_DSTATE_a = L4_MABX_B.Operator_ee; |
| 28812 | |
| 28813 | /* Update for UnitDelay: '<S1056>/Unit Delay' */ |
| 28814 | L4_MABX_DW.UnitDelay_DSTATE_a = L4_MABX_B.Switch1_p2; |
| 28815 | |
| 28816 | /* End of Update for SubSystem: '<S855>/CAN_TX_5000ms' */ |
| 28817 | } |
| 28818 | |
| 28819 | /* Model output function for TID8 */ |
| 28820 | void L4_MABX_output8(void) /* Sample time: [10.0s, 0.0s] */ |
| 28821 | { |
| 28822 | int_T tid = 8; |
| 28823 | |
| 28824 | /* user code (Output function Trailer for TID8) */ |
| 28825 | |
| 28826 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 28827 | /* EventChannel: 0 */ |
| 28828 | if (tid == 0) { |
| 28829 | DSXCP_service(0); |
| 28830 | } |
| 28831 | |
| 28832 | /* If subsystem generates rate grouping Output functions, |
| 28833 | * when tid is used in Output function for one rate, |
| 28834 | * all Output functions include tid as a local variable. |
| 28835 | * As result, some Output functions may have unused tid. |
| 28836 | */ |
| 28837 | UNUSED_PARAMETER(tid); |
| 28838 | } |
| 28839 | |
| 28840 | /* Model update function for TID8 */ |
| 28841 | void L4_MABX_update8(void) /* Sample time: [10.0s, 0.0s] */ |
| 28842 | { |
| 28843 | /* (no update code required) */ |
| 28844 | } |
| 28845 | |
| 28846 | /* Model output wrapper function for compatibility with a static main program */ |
| 28847 | void L4_MABX_output(int_T tid) |
| 28848 | { |
| 28849 | switch (tid) { |
| 28850 | case 0 : |
| 28851 | L4_MABX_output0(); |
| 28852 | break; |
| 28853 | |
| 28854 | case 1 : |
| 28855 | L4_MABX_output1(); |
| 28856 | break; |
| 28857 | |
| 28858 | case 2 : |
| 28859 | L4_MABX_output2(); |
| 28860 | break; |
| 28861 | |
| 28862 | case 3 : |
| 28863 | L4_MABX_output3(); |
| 28864 | break; |
| 28865 | |
| 28866 | case 4 : |
| 28867 | L4_MABX_output4(); |
| 28868 | break; |
| 28869 | |
| 28870 | case 5 : |
| 28871 | L4_MABX_output5(); |
| 28872 | break; |
| 28873 | |
| 28874 | case 6 : |
| 28875 | L4_MABX_output6(); |
| 28876 | break; |
| 28877 | |
| 28878 | case 7 : |
| 28879 | L4_MABX_output7(); |
| 28880 | break; |
| 28881 | |
| 28882 | case 8 : |
| 28883 | L4_MABX_output8(); |
| 28884 | break; |
| 28885 | |
| 28886 | default : |
| 28887 | break; |
| 28888 | } |
| 28889 | } |
| 28890 | |
| 28891 | /* Model update wrapper function for compatibility with a static main program */ |
| 28892 | void L4_MABX_update(int_T tid) |
| 28893 | { |
| 28894 | switch (tid) { |
| 28895 | case 0 : |
| 28896 | L4_MABX_update0(); |
| 28897 | break; |
| 28898 | |
| 28899 | case 1 : |
| 28900 | L4_MABX_update1(); |
| 28901 | break; |
| 28902 | |
| 28903 | case 2 : |
| 28904 | L4_MABX_update2(); |
| 28905 | break; |
| 28906 | |
| 28907 | case 3 : |
| 28908 | L4_MABX_update3(); |
| 28909 | break; |
| 28910 | |
| 28911 | case 4 : |
| 28912 | L4_MABX_update4(); |
| 28913 | break; |
| 28914 | |
| 28915 | case 5 : |
| 28916 | L4_MABX_update5(); |
| 28917 | break; |
| 28918 | |
| 28919 | case 6 : |
| 28920 | L4_MABX_update6(); |
| 28921 | break; |
| 28922 | |
| 28923 | case 7 : |
| 28924 | L4_MABX_update7(); |
| 28925 | break; |
| 28926 | |
| 28927 | case 8 : |
| 28928 | L4_MABX_update8(); |
| 28929 | break; |
| 28930 | |
| 28931 | default : |
| 28932 | break; |
| 28933 | } |
| 28934 | } |
| 28935 | |
| 28936 | /* Model initialize function */ |
| 28937 | void L4_MABX_initialize(void) |
| 28938 | { |
| 28939 | /* Registration code */ |
| 28940 | |
| 28941 | /* initialize non-finites */ |
| 28942 | rt_InitInfAndNaN(sizeof(real_T)); |
| 28943 | |
| 28944 | /* non-finite (run-time) assignments */ |
| 28945 | L4_MABX_P.Saturation_UpperSat = rtInf; |
| 28946 | L4_MABX_P.Saturation_UpperSat_o = rtInf; |
| 28947 | L4_MABX_P.Saturation_UpperSat_f = rtInf; |
| 28948 | L4_MABX_P.Saturation1_UpperSat_j = rtInf; |
| 28949 | L4_MABX_P.Saturation_UpperSat_l = rtInf; |
| 28950 | L4_MABX_P.Saturation_UpperSat_o1 = rtInf; |
| 28951 | L4_MABX_P.Saturation_UpperSat_d = rtInf; |
| 28952 | L4_MABX_P.Saturation_UpperSat_ok = rtInf; |
| 28953 | L4_MABX_P.Saturation_UpperSat_ld = rtInf; |
| 28954 | L4_MABX_P.Saturation_UpperSat_b = rtInf; |
| 28955 | L4_MABX_P.Calculate_D_term_h.Saturation_UpperSat = rtInf; |
| 28956 | L4_MABX_P.Calculate_D_term_p.Saturation_UpperSat = rtInf; |
| 28957 | L4_MABX_P.Calculate_D_term.Saturation_UpperSat = rtInf; |
| 28958 | |
| 28959 | /* initialize real-time model */ |
| 28960 | (void) memset((void *)L4_MABX_M, 0, |
| 28961 | sizeof(RT_MODEL_L4_MABX_T)); |
| 28962 | (L4_MABX_M)->Timing.TaskCounters.cLimit[0] = 1; |
| 28963 | (L4_MABX_M)->Timing.TaskCounters.cLimit[1] = 2; |
| 28964 | (L4_MABX_M)->Timing.TaskCounters.cLimit[2] = 5; |
| 28965 | (L4_MABX_M)->Timing.TaskCounters.cLimit[3] = 10; |
| 28966 | (L4_MABX_M)->Timing.TaskCounters.cLimit[4] = 25; |
| 28967 | (L4_MABX_M)->Timing.TaskCounters.cLimit[5] = 50; |
| 28968 | (L4_MABX_M)->Timing.TaskCounters.cLimit[6] = 100; |
| 28969 | (L4_MABX_M)->Timing.TaskCounters.cLimit[7] = 500; |
| 28970 | (L4_MABX_M)->Timing.TaskCounters.cLimit[8] = 1000; |
| 28971 | rtsiSetSolverName(&L4_MABX_M->solverInfo,"FixedStepDiscrete"); |
| 28972 | L4_MABX_M->solverInfoPtr = (&L4_MABX_M->solverInfo); |
| 28973 | |
| 28974 | /* Initialize timing info */ |
| 28975 | { |
| 28976 | int_T *mdlTsMap = L4_MABX_M->Timing.sampleTimeTaskIDArray; |
| 28977 | int_T i; |
| 28978 | for (i = 0; i < 9; i++) { |
| 28979 | mdlTsMap[i] = i; |
| 28980 | } |
| 28981 | |
| 28982 | L4_MABX_M->Timing.sampleTimeTaskIDPtr = (&mdlTsMap[0]); |
| 28983 | L4_MABX_M->Timing.sampleTimes = (&L4_MABX_M->Timing.sampleTimesArray[0]); |
| 28984 | L4_MABX_M->Timing.offsetTimes = (&L4_MABX_M->Timing.offsetTimesArray[0]); |
| 28985 | |
| 28986 | /* task periods */ |
| 28987 | L4_MABX_M->Timing.sampleTimes[0] = (0.01); |
| 28988 | L4_MABX_M->Timing.sampleTimes[1] = (0.02); |
| 28989 | L4_MABX_M->Timing.sampleTimes[2] = (0.05); |
| 28990 | L4_MABX_M->Timing.sampleTimes[3] = (0.1); |
| 28991 | L4_MABX_M->Timing.sampleTimes[4] = (0.25); |
| 28992 | L4_MABX_M->Timing.sampleTimes[5] = (0.5); |
| 28993 | L4_MABX_M->Timing.sampleTimes[6] = (1.0); |
| 28994 | L4_MABX_M->Timing.sampleTimes[7] = (5.0); |
| 28995 | L4_MABX_M->Timing.sampleTimes[8] = (10.0); |
| 28996 | |
| 28997 | /* task offsets */ |
| 28998 | L4_MABX_M->Timing.offsetTimes[0] = (0.0); |
| 28999 | L4_MABX_M->Timing.offsetTimes[1] = (0.0); |
| 29000 | L4_MABX_M->Timing.offsetTimes[2] = (0.0); |
| 29001 | L4_MABX_M->Timing.offsetTimes[3] = (0.0); |
| 29002 | L4_MABX_M->Timing.offsetTimes[4] = (0.0); |
| 29003 | L4_MABX_M->Timing.offsetTimes[5] = (0.0); |
| 29004 | L4_MABX_M->Timing.offsetTimes[6] = (0.0); |
| 29005 | L4_MABX_M->Timing.offsetTimes[7] = (0.0); |
| 29006 | L4_MABX_M->Timing.offsetTimes[8] = (0.0); |
| 29007 | } |
| 29008 | |
| 29009 | rtmSetTPtr(L4_MABX_M, &L4_MABX_M->Timing.tArray[0]); |
| 29010 | |
| 29011 | { |
| 29012 | int_T *mdlSampleHits = L4_MABX_M->Timing.sampleHitArray; |
| 29013 | int_T *mdlPerTaskSampleHits = L4_MABX_M->Timing.perTaskSampleHitsArray; |
| 29014 | L4_MABX_M->Timing.perTaskSampleHits = (&mdlPerTaskSampleHits[0]); |
| 29015 | mdlSampleHits[0] = 1; |
| 29016 | L4_MABX_M->Timing.sampleHits = (&mdlSampleHits[0]); |
| 29017 | } |
| 29018 | |
| 29019 | rtmSetTFinal(L4_MABX_M, -1); |
| 29020 | L4_MABX_M->Timing.stepSize0 = 0.01; |
| 29021 | L4_MABX_M->Timing.stepSize9 = 2.3283064365386963E-10; |
| 29022 | L4_MABX_M->Timing.stepSize10 = 2.3283064365386963E-10; |
| 29023 | L4_MABX_M->Timing.stepSize11 = 2.3283064365386963E-10; |
| 29024 | L4_MABX_M->solverInfoPtr = (&L4_MABX_M->solverInfo); |
| 29025 | L4_MABX_M->Timing.stepSize = (0.01); |
| 29026 | rtsiSetFixedStepSize(&L4_MABX_M->solverInfo, 0.01); |
| 29027 | rtsiSetSolverMode(&L4_MABX_M->solverInfo, SOLVER_MODE_MULTITASKING); |
| 29028 | |
| 29029 | /* block I/O */ |
| 29030 | (void) memset(((void *) &L4_MABX_B), 0, |
| 29031 | sizeof(B_L4_MABX_T)); |
| 29032 | |
| 29033 | { |
| 29034 | L4_MABX_B.EPBPCMInhibitStatusFeedback = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE; |
| 29035 | L4_MABX_B.EPBPCMInhibitStatusFeedback_i = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE; |
| 29036 | L4_MABX_B.EPBPCMManualStatusFeedback = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE; |
| 29037 | L4_MABX_B.EPBPCMManualStatusFeedback_j = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE; |
| 29038 | L4_MABX_B.EPBPCMInhibitStatusFeedback_g = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE; |
| 29039 | L4_MABX_B.EPBPCMInhibitStatusFeedback_k = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE; |
| 29040 | L4_MABX_B.EPBPCMManualStatusFeedback_g = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE; |
| 29041 | L4_MABX_B.EPBPCMManualStatusFeedback_h = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE; |
| 29042 | L4_MABX_B.XPRErrorState = ENUM_XPR_ERROR_STATE_T_XPR_OK; |
| 29043 | L4_MABX_B.XPRErrorState_d = ENUM_XPR_ERROR_STATE_T_XPR_OK; |
| 29044 | L4_MABX_B.XPRControlMode = ENUM_XPR_CONTROL_MODE_T_NO_BRAKE_DEMAND; |
| 29045 | L4_MABX_B.XPRControlMode_d = ENUM_XPR_CONTROL_MODE_T_NO_BRAKE_DEMAND; |
| 29046 | L4_MABX_B.XBRPassThroughActive = ENUM_XBR_PASS_THROUGH_ACTIVE_T_NOT_ACTIVE; |
| 29047 | L4_MABX_B.DataTypeConversion_lr = ENUM_SWITCH_T_OFF; |
| 29048 | L4_MABX_B.DataTypeConversion1_lu = ENUM_SWITCH_T_OFF; |
| 29049 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE; |
| 29050 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE; |
| 29051 | L4_MABX_B.BrkPedArbBrakeSwitch = ENUM_J1939_SWITCH_T_OFF; |
| 29052 | L4_MABX_B.BrkPedArbBrakeSwitch_c = ENUM_J1939_SWITCH_T_OFF; |
| 29053 | L4_MABX_B.DataTypeConversion1_cy = ENUM_J1939_SWITCH_T_OFF; |
| 29054 | L4_MABX_B.DataTypeConversion3_l = ENUM_J1939_SWITCH_T_OFF; |
| 29055 | L4_MABX_B.VehCtrlState = ENUM_AUTO_CTRL_VEHICLE_STATE_T_NOT_AVAILABLE; |
| 29056 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_NOT_AVAILABLE; |
| 29057 | L4_MABX_B.If_Then_Else_b2.XBRPriority = ENUM_XBR_PRIORITY_T_HIGHEST_PRIORITY; |
| 29058 | L4_MABX_B.If_Then_Else_b2.XBRPassThroughActive = |
| 29059 | ENUM_XBR_PASS_THROUGH_ACTIVE_T_NOT_ACTIVE; |
| 29060 | L4_MABX_B.If_Then_Else_b2.XBREnduranceBrakeIntegrationMod = |
| 29061 | ENUM_XBR_EBI_MODE_T_NO_EBI_ALLOWED; |
| 29062 | L4_MABX_B.If_Then_Else_b2.XBRControlMode = |
| 29063 | ENUM_XBR_CONTROL_MODE_T_OVERRIDE_DISABLED; |
| 29064 | } |
| 29065 | |
| 29066 | /* exported global signals */ |
| 29067 | GLB_Absolute_Timestamp = 0.0; |
| 29068 | ReAX_ActualHandwheelPos = 0.0; |
| 29069 | EthernetLinkStatus = 0.0; |
| 29070 | CurrentAzimuth_rad = 0.0; |
| 29071 | TargetAzimuth_rad = 0.0; |
| 29072 | TargetVelocity_kph = 0.0; |
| 29073 | Curvature = 0.0; |
| 29074 | CrosstrackError = 0.0; |
| 29075 | CurrentVelocity_kph = 0.0; |
| 29076 | GPS_X = 0.0; |
| 29077 | GPS_Y = 0.0; |
| 29078 | GPS_Time = 0.0; |
| 29079 | ReAX_EchoedSteerWheelPos = 0.0; |
| 29080 | SteerWheelAngle = 0.0; |
| 29081 | YawRate = 0.0; |
| 29082 | SPN1810_LongitudinalAcceleration = 0.0; |
| 29083 | WheelBasedVehicleSpeed = 0.0; |
| 29084 | BrakeSwitch = 0.0; |
| 29085 | Lateral_Control_Rate_Limit = 0.0; |
| 29086 | Lateral_Control_Output = 0.0; |
| 29087 | Lateral_Control_Rate_Limiter_Output = 0.0; |
| 29088 | Stanley_Rate_Limit = 0.0; |
| 29089 | Stanley_Set_Gain = 0.0; |
| 29090 | Understeer_Correction_Output = 0.0; |
| 29091 | Stanley_Output = 0.0; |
| 29092 | Stanley_Rate_Limiter_Output = 0.0; |
| 29093 | SteerCommandDeg = 0.0; |
| 29094 | DesiredSteeringAngle = 0.0; |
| 29095 | Lateral_Control_Heading_Error = 0.0; |
| 29096 | DIAG_CAN1_Count_Stuff_Errors = 0U; |
| 29097 | DIAG_CAN1_Count_Format_Errors = 0U; |
| 29098 | DIAG_CAN1_Count_Ack_Errors = 0U; |
| 29099 | DIAG_CAN1_Count_Bit0_Errors = 0U; |
| 29100 | DIAG_CAN1_Count_Bit1_Errors = 0U; |
| 29101 | DIAG_CAN1_Count_CRC_Errors = 0U; |
| 29102 | DIAG_CAN1_Count_RX_Lost = 0U; |
| 29103 | DIAG_CAN1_Count_RX_OK = 0U; |
| 29104 | DIAG_CAN1_Count_TX_OK = 0U; |
| 29105 | DIAG_CAN5_Count_Stuff_Errors = 0U; |
| 29106 | DIAG_CAN5_Count_Format_Errors = 0U; |
| 29107 | DIAG_CAN5_Count_Ack_Errors = 0U; |
| 29108 | DIAG_CAN5_Count_Bit0_Errors = 0U; |
| 29109 | DIAG_CAN5_Count_Bit1_Errors = 0U; |
| 29110 | DIAG_CAN5_Count_CRC_Errors = 0U; |
| 29111 | DIAG_CAN5_Count_RX_Lost = 0U; |
| 29112 | DIAG_CAN5_Count_RX_OK = 0U; |
| 29113 | DIAG_CAN5_Count_TX_OK = 0U; |
| 29114 | DIAG_CAN6_Count_Stuff_Errors = 0U; |
| 29115 | DIAG_CAN6_Count_Format_Errors = 0U; |
| 29116 | DIAG_CAN6_Count_Ack_Errors = 0U; |
| 29117 | DIAG_CAN6_Count_Bit0_Errors = 0U; |
| 29118 | DIAG_CAN6_Count_Bit1_Errors = 0U; |
| 29119 | DIAG_CAN6_Count_CRC_Errors = 0U; |
| 29120 | DIAG_CAN6_Count_RX_Lost = 0U; |
| 29121 | DIAG_CAN6_Count_RX_OK = 0U; |
| 29122 | DIAG_CAN6_Count_TX_OK = 0U; |
| 29123 | DIAG_CAN3_Count_Stuff_Errors = 0U; |
| 29124 | DIAG_CAN3_Count_Format_Errors = 0U; |
| 29125 | DIAG_CAN3_Count_Ack_Errors = 0U; |
| 29126 | DIAG_CAN3_Count_Bit0_Errors = 0U; |
| 29127 | DIAG_CAN3_Count_Bit1_Errors = 0U; |
| 29128 | DIAG_CAN3_Count_CRC_Errors = 0U; |
| 29129 | DIAG_CAN3_Count_RX_Lost = 0U; |
| 29130 | DIAG_CAN3_Count_RX_OK = 0U; |
| 29131 | DIAG_CAN3_Count_TX_OK = 0U; |
| 29132 | DIAG_CAN4_Count_Stuff_Errors = 0U; |
| 29133 | DIAG_CAN4_Count_Format_Errors = 0U; |
| 29134 | DIAG_CAN4_Count_Ack_Errors = 0U; |
| 29135 | DIAG_CAN4_Count_Bit0_Errors = 0U; |
| 29136 | DIAG_CAN4_Count_Bit1_Errors = 0U; |
| 29137 | DIAG_CAN4_Count_CRC_Errors = 0U; |
| 29138 | DIAG_CAN4_Count_RX_Lost = 0U; |
| 29139 | DIAG_CAN4_Count_RX_OK = 0U; |
| 29140 | DIAG_CAN4_Count_TX_OK = 0U; |
| 29141 | DIAG_CAN2_Count_Stuff_Errors = 0U; |
| 29142 | DIAG_CAN2_Count_Format_Errors = 0U; |
| 29143 | DIAG_CAN2_Count_Ack_Errors = 0U; |
| 29144 | DIAG_CAN2_Count_Bit0_Errors = 0U; |
| 29145 | DIAG_CAN2_Count_Bit1_Errors = 0U; |
| 29146 | DIAG_CAN2_Count_CRC_Errors = 0U; |
| 29147 | DIAG_CAN2_Count_RX_Lost = 0U; |
| 29148 | DIAG_CAN2_Count_RX_OK = 0U; |
| 29149 | DIAG_CAN2_Count_TX_OK = 0U; |
| 29150 | REAX_Handwheel_Torque = 0.0F; |
| 29151 | REAX_Handwheel_Velocity = 0.0F; |
| 29152 | REAX_Pull_Compensation = 0.0F; |
| 29153 | DIAG_CAN1_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE; |
| 29154 | DIAG_CAN5_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE; |
| 29155 | DIAG_CAN6_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE; |
| 29156 | DIAG_CAN3_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE; |
| 29157 | DIAG_CAN4_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE; |
| 29158 | DIAG_CAN2_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE; |
| 29159 | SupervisorMode = 0U; |
| 29160 | REAX_Current_Mode = 0U; |
| 29161 | REAX_Req_Mode = 0U; |
| 29162 | REAX_Status = 0U; |
| 29163 | |
| 29164 | { |
| 29165 | int32_T i; |
| 29166 | for (i = 0; i < 100; i++) { |
| 29167 | GLB_SWVERSION_CPV_[i] = ((uint8_T)0U); |
| 29168 | } |
| 29169 | } |
| 29170 | |
| 29171 | MABX_Mode = 0U; |
| 29172 | EStop = false; |
| 29173 | EnableSw = false; |
| 29174 | EngagePB = false; |
| 29175 | BrakeSW = false; |
| 29176 | MABX_Heartbeat = false; |
| 29177 | Heartbeat_Ok = false; |
| 29178 | RTMapsOk = false; |
| 29179 | LogEventPB = false; |
| 29180 | AutonomousOutputEnabled = false; |
| 29181 | Stanley_Limiter_Active = false; |
| 29182 | RateLimiterActive = false; |
| 29183 | Pedal_pwm_position = 0.0; |
| 29184 | |
| 29185 | /* states (dwork) */ |
| 29186 | (void) memset((void *)&L4_MABX_DW, 0, |
| 29187 | sizeof(DW_L4_MABX_T)); |
| 29188 | |
| 29189 | /* child S-Function registration */ |
| 29190 | { |
| 29191 | RTWSfcnInfo *sfcnInfo = &L4_MABX_M->NonInlinedSFcns.sfcnInfo; |
| 29192 | L4_MABX_M->sfcnInfo = (sfcnInfo); |
| 29193 | rtssSetErrorStatusPtr(sfcnInfo, (&rtmGetErrorStatus(L4_MABX_M))); |
| 29194 | rtssSetNumRootSampTimesPtr(sfcnInfo, &L4_MABX_M->Sizes.numSampTimes); |
| 29195 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[0] = &(rtmGetTPtr(L4_MABX_M)[0]); |
| 29196 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[1] = &(rtmGetTPtr(L4_MABX_M)[1]); |
| 29197 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[2] = &(rtmGetTPtr(L4_MABX_M)[2]); |
| 29198 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[3] = &(rtmGetTPtr(L4_MABX_M)[3]); |
| 29199 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[4] = &(rtmGetTPtr(L4_MABX_M)[4]); |
| 29200 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[5] = &(rtmGetTPtr(L4_MABX_M)[5]); |
| 29201 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[6] = &(rtmGetTPtr(L4_MABX_M)[6]); |
| 29202 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[7] = &(rtmGetTPtr(L4_MABX_M)[7]); |
| 29203 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[8] = &(rtmGetTPtr(L4_MABX_M)[8]); |
| 29204 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[9] = &(rtmGetTPtr(L4_MABX_M)[9]); |
| 29205 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[10] = &(rtmGetTPtr(L4_MABX_M)[10]); |
| 29206 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[11] = &(rtmGetTPtr(L4_MABX_M)[11]); |
| 29207 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[12] = &(rtmGetTPtr(L4_MABX_M)[12]); |
| 29208 | rtssSetTPtrPtr(sfcnInfo,L4_MABX_M->NonInlinedSFcns.taskTimePtrs); |
| 29209 | rtssSetTStartPtr(sfcnInfo, &rtmGetTStart(L4_MABX_M)); |
| 29210 | rtssSetTFinalPtr(sfcnInfo, &rtmGetTFinal(L4_MABX_M)); |
| 29211 | rtssSetTimeOfLastOutputPtr(sfcnInfo, &rtmGetTimeOfLastOutput(L4_MABX_M)); |
| 29212 | rtssSetStepSizePtr(sfcnInfo, &L4_MABX_M->Timing.stepSize); |
| 29213 | rtssSetStopRequestedPtr(sfcnInfo, &rtmGetStopRequested(L4_MABX_M)); |
| 29214 | rtssSetDerivCacheNeedsResetPtr(sfcnInfo, &L4_MABX_M->derivCacheNeedsReset); |
| 29215 | rtssSetZCCacheNeedsResetPtr(sfcnInfo, &L4_MABX_M->zCCacheNeedsReset); |
| 29216 | rtssSetContTimeOutputInconsistentWithStateAtMajorStepPtr(sfcnInfo, |
| 29217 | &L4_MABX_M->CTOutputIncnstWithState); |
| 29218 | rtssSetSampleHitsPtr(sfcnInfo, &L4_MABX_M->Timing.sampleHits); |
| 29219 | rtssSetPerTaskSampleHitsPtr(sfcnInfo, &L4_MABX_M->Timing.perTaskSampleHits); |
| 29220 | rtssSetSimModePtr(sfcnInfo, &L4_MABX_M->simMode); |
| 29221 | rtssSetSolverInfoPtr(sfcnInfo, &L4_MABX_M->solverInfoPtr); |
| 29222 | } |
| 29223 | |
| 29224 | L4_MABX_M->Sizes.numSFcns = (5); |
| 29225 | |
| 29226 | /* register each child */ |
| 29227 | { |
| 29228 | (void) memset((void *)&L4_MABX_M->NonInlinedSFcns.childSFunctions[0], 0, |
| 29229 | 5*sizeof(SimStruct)); |
| 29230 | L4_MABX_M->childSfunctions = (&L4_MABX_M-> |
| 29231 | NonInlinedSFcns.childSFunctionPtrs[0]); |
| 29232 | |
| 29233 | { |
| 29234 | int_T i; |
| 29235 | for (i = 0; i < 5; i++) { |
| 29236 | L4_MABX_M->childSfunctions[i] = |
| 29237 | (&L4_MABX_M->NonInlinedSFcns.childSFunctions[i]); |
| 29238 | } |
| 29239 | } |
| 29240 | |
| 29241 | /* Level2 S-Function Block: L4_MABX/<S415>/dsa_tcpip_bkg_sfcn (dsa_tcpip_bkg_sfcn) */ |
| 29242 | { |
| 29243 | SimStruct *rts = L4_MABX_M->childSfunctions[0]; |
| 29244 | |
| 29245 | /* timing info */ |
| 29246 | time_T *sfcnPeriod = L4_MABX_M->NonInlinedSFcns.Sfcn0.sfcnPeriod; |
| 29247 | time_T *sfcnOffset = L4_MABX_M->NonInlinedSFcns.Sfcn0.sfcnOffset; |
| 29248 | int_T *sfcnTsMap = L4_MABX_M->NonInlinedSFcns.Sfcn0.sfcnTsMap; |
| 29249 | (void) memset((void*)sfcnPeriod, 0, |
| 29250 | sizeof(time_T)*1); |
| 29251 | (void) memset((void*)sfcnOffset, 0, |
| 29252 | sizeof(time_T)*1); |
| 29253 | ssSetSampleTimePtr(rts, &sfcnPeriod[0]); |
| 29254 | ssSetOffsetTimePtr(rts, &sfcnOffset[0]); |
| 29255 | ssSetSampleTimeTaskIDPtr(rts, sfcnTsMap); |
| 29256 | |
| 29257 | { |
| 29258 | ssSetBlkInfo2Ptr(rts, &L4_MABX_M->NonInlinedSFcns.blkInfo2[0]); |
| 29259 | } |
| 29260 | |
| 29261 | _ssSetBlkInfo2PortInfo2Ptr(rts, |
| 29262 | &L4_MABX_M->NonInlinedSFcns.inputOutputPortInfo2[0]); |
| 29263 | |
| 29264 | /* Set up the mdlInfo pointer */ |
| 29265 | ssSetRTWSfcnInfo(rts, L4_MABX_M->sfcnInfo); |
| 29266 | |
| 29267 | /* Allocate memory of model methods 2 */ |
| 29268 | { |
| 29269 | ssSetModelMethods2(rts, &L4_MABX_M->NonInlinedSFcns.methods2[0]); |
| 29270 | } |
| 29271 | |
| 29272 | /* Allocate memory of model methods 3 */ |
| 29273 | { |
| 29274 | ssSetModelMethods3(rts, &L4_MABX_M->NonInlinedSFcns.methods3[0]); |
| 29275 | } |
| 29276 | |
| 29277 | /* Allocate memory of model methods 4 */ |
| 29278 | { |
| 29279 | ssSetModelMethods4(rts, &L4_MABX_M->NonInlinedSFcns.methods4[0]); |
| 29280 | } |
| 29281 | |
| 29282 | /* Allocate memory for states auxilliary information */ |
| 29283 | { |
| 29284 | ssSetStatesInfo2(rts, &L4_MABX_M->NonInlinedSFcns.statesInfo2[0]); |
| 29285 | ssSetPeriodicStatesInfo(rts, |
| 29286 | &L4_MABX_M->NonInlinedSFcns.periodicStatesInfo[0]); |
| 29287 | } |
| 29288 | |
| 29289 | /* path info */ |
| 29290 | ssSetModelName(rts, "dsa_tcpip_bkg_sfcn"); |
| 29291 | ssSetPath(rts, |
| 29292 | "L4_MABX/ETHERNET/TCPIP_Setup/Background_Task/dsa_tcpip_bkg_sfcn"); |
| 29293 | ssSetRTModel(rts,L4_MABX_M); |
| 29294 | ssSetParentSS(rts, (NULL)); |
| 29295 | ssSetRootSS(rts, rts); |
| 29296 | ssSetVersion(rts, SIMSTRUCT_VERSION_LEVEL2); |
| 29297 | |
| 29298 | /* work vectors */ |
| 29299 | ssSetIWork(rts, (int_T *) &L4_MABX_DW.dsa_tcpip_bkg_sfcn_IWORK); |
| 29300 | |
| 29301 | { |
| 29302 | struct _ssDWorkRecord *dWorkRecord = (struct _ssDWorkRecord *) |
| 29303 | &L4_MABX_M->NonInlinedSFcns.Sfcn0.dWork; |
| 29304 | struct _ssDWorkAuxRecord *dWorkAuxRecord = (struct _ssDWorkAuxRecord *) |
| 29305 | &L4_MABX_M->NonInlinedSFcns.Sfcn0.dWorkAux; |
| 29306 | ssSetSFcnDWork(rts, dWorkRecord); |
| 29307 | ssSetSFcnDWorkAux(rts, dWorkAuxRecord); |
| 29308 | _ssSetNumDWork(rts, 1); |
| 29309 | |
| 29310 | /* IWORK */ |
| 29311 | ssSetDWorkWidth(rts, 0, 1); |
| 29312 | ssSetDWorkDataType(rts, 0,SS_INTEGER); |
| 29313 | ssSetDWorkComplexSignal(rts, 0, 0); |
| 29314 | ssSetDWork(rts, 0, &L4_MABX_DW.dsa_tcpip_bkg_sfcn_IWORK); |
| 29315 | } |
| 29316 | |
| 29317 | /* registration */ |
| 29318 | dsa_tcpip_bkg_sfcn(rts); |
| 29319 | sfcnInitializeSizes(rts); |
| 29320 | sfcnInitializeSampleTimes(rts); |
| 29321 | |
| 29322 | /* adjust sample time */ |
| 29323 | ssSetSampleTime(rts, 0, -1.0); |
| 29324 | ssSetOffsetTime(rts, 0, -2.0); |
| 29325 | sfcnTsMap[0] = 9; |
| 29326 | |
| 29327 | /* set compiled values of dynamic vector attributes */ |
| 29328 | ssSetNumNonsampledZCs(rts, 0); |
| 29329 | |
| 29330 | /* Update connectivity flags for each port */ |
| 29331 | /* Update the BufferDstPort flags for each input port */ |
| 29332 | } |
| 29333 | |
| 29334 | /* Level2 S-Function Block: L4_MABX/<S416>/dsa_tcpip_irq_l2_sfcn (dsa_tcpip_irq_l2_sfcn) */ |
| 29335 | { |
| 29336 | SimStruct *rts = L4_MABX_M->childSfunctions[1]; |
| 29337 | |
| 29338 | /* timing info */ |
| 29339 | time_T *sfcnPeriod = L4_MABX_M->NonInlinedSFcns.Sfcn1.sfcnPeriod; |
| 29340 | time_T *sfcnOffset = L4_MABX_M->NonInlinedSFcns.Sfcn1.sfcnOffset; |
| 29341 | int_T *sfcnTsMap = L4_MABX_M->NonInlinedSFcns.Sfcn1.sfcnTsMap; |
| 29342 | (void) memset((void*)sfcnPeriod, 0, |
| 29343 | sizeof(time_T)*1); |
| 29344 | (void) memset((void*)sfcnOffset, 0, |
| 29345 | sizeof(time_T)*1); |
| 29346 | ssSetSampleTimePtr(rts, &sfcnPeriod[0]); |
| 29347 | ssSetOffsetTimePtr(rts, &sfcnOffset[0]); |
| 29348 | ssSetSampleTimeTaskIDPtr(rts, sfcnTsMap); |
| 29349 | |
| 29350 | { |
| 29351 | ssSetBlkInfo2Ptr(rts, &L4_MABX_M->NonInlinedSFcns.blkInfo2[1]); |
| 29352 | } |
| 29353 | |
| 29354 | _ssSetBlkInfo2PortInfo2Ptr(rts, |
| 29355 | &L4_MABX_M->NonInlinedSFcns.inputOutputPortInfo2[1]); |
| 29356 | |
| 29357 | /* Set up the mdlInfo pointer */ |
| 29358 | ssSetRTWSfcnInfo(rts, L4_MABX_M->sfcnInfo); |
| 29359 | |
| 29360 | /* Allocate memory of model methods 2 */ |
| 29361 | { |
| 29362 | ssSetModelMethods2(rts, &L4_MABX_M->NonInlinedSFcns.methods2[1]); |
| 29363 | } |
| 29364 | |
| 29365 | /* Allocate memory of model methods 3 */ |
| 29366 | { |
| 29367 | ssSetModelMethods3(rts, &L4_MABX_M->NonInlinedSFcns.methods3[1]); |
| 29368 | } |
| 29369 | |
| 29370 | /* Allocate memory of model methods 4 */ |
| 29371 | { |
| 29372 | ssSetModelMethods4(rts, &L4_MABX_M->NonInlinedSFcns.methods4[1]); |
| 29373 | } |
| 29374 | |
| 29375 | /* Allocate memory for states auxilliary information */ |
| 29376 | { |
| 29377 | ssSetStatesInfo2(rts, &L4_MABX_M->NonInlinedSFcns.statesInfo2[1]); |
| 29378 | ssSetPeriodicStatesInfo(rts, |
| 29379 | &L4_MABX_M->NonInlinedSFcns.periodicStatesInfo[1]); |
| 29380 | } |
| 29381 | |
| 29382 | /* path info */ |
| 29383 | ssSetModelName(rts, "dsa_tcpip_irq_l2_sfcn"); |
| 29384 | ssSetPath(rts, |
| 29385 | "L4_MABX/ETHERNET/TCPIP_Setup/IRQ_Level_2_SW_INT/dsa_tcpip_irq_l2_sfcn"); |
| 29386 | ssSetRTModel(rts,L4_MABX_M); |
| 29387 | ssSetParentSS(rts, (NULL)); |
| 29388 | ssSetRootSS(rts, rts); |
| 29389 | ssSetVersion(rts, SIMSTRUCT_VERSION_LEVEL2); |
| 29390 | |
| 29391 | /* registration */ |
| 29392 | dsa_tcpip_irq_l2_sfcn(rts); |
| 29393 | sfcnInitializeSizes(rts); |
| 29394 | sfcnInitializeSampleTimes(rts); |
| 29395 | |
| 29396 | /* adjust sample time */ |
| 29397 | ssSetSampleTime(rts, 0, -1.0); |
| 29398 | ssSetOffsetTime(rts, 0, -3.0); |
| 29399 | sfcnTsMap[0] = 10; |
| 29400 | |
| 29401 | /* set compiled values of dynamic vector attributes */ |
| 29402 | ssSetNumNonsampledZCs(rts, 0); |
| 29403 | |
| 29404 | /* Update connectivity flags for each port */ |
| 29405 | /* Update the BufferDstPort flags for each input port */ |
| 29406 | } |
| 29407 | |
| 29408 | /* Level2 S-Function Block: L4_MABX/<S417>/dsa_tcpip_irq_l1_sfcn (dsa_tcpip_irq_l1_sfcn) */ |
| 29409 | { |
| 29410 | SimStruct *rts = L4_MABX_M->childSfunctions[2]; |
| 29411 | |
| 29412 | /* timing info */ |
| 29413 | time_T *sfcnPeriod = L4_MABX_M->NonInlinedSFcns.Sfcn2.sfcnPeriod; |
| 29414 | time_T *sfcnOffset = L4_MABX_M->NonInlinedSFcns.Sfcn2.sfcnOffset; |
| 29415 | int_T *sfcnTsMap = L4_MABX_M->NonInlinedSFcns.Sfcn2.sfcnTsMap; |
| 29416 | (void) memset((void*)sfcnPeriod, 0, |
| 29417 | sizeof(time_T)*1); |
| 29418 | (void) memset((void*)sfcnOffset, 0, |
| 29419 | sizeof(time_T)*1); |
| 29420 | ssSetSampleTimePtr(rts, &sfcnPeriod[0]); |
| 29421 | ssSetOffsetTimePtr(rts, &sfcnOffset[0]); |
| 29422 | ssSetSampleTimeTaskIDPtr(rts, sfcnTsMap); |
| 29423 | |
| 29424 | { |
| 29425 | ssSetBlkInfo2Ptr(rts, &L4_MABX_M->NonInlinedSFcns.blkInfo2[2]); |
| 29426 | } |
| 29427 | |
| 29428 | _ssSetBlkInfo2PortInfo2Ptr(rts, |
| 29429 | &L4_MABX_M->NonInlinedSFcns.inputOutputPortInfo2[2]); |
| 29430 | |
| 29431 | /* Set up the mdlInfo pointer */ |
| 29432 | ssSetRTWSfcnInfo(rts, L4_MABX_M->sfcnInfo); |
| 29433 | |
| 29434 | /* Allocate memory of model methods 2 */ |
| 29435 | { |
| 29436 | ssSetModelMethods2(rts, &L4_MABX_M->NonInlinedSFcns.methods2[2]); |
| 29437 | } |
| 29438 | |
| 29439 | /* Allocate memory of model methods 3 */ |
| 29440 | { |
| 29441 | ssSetModelMethods3(rts, &L4_MABX_M->NonInlinedSFcns.methods3[2]); |
| 29442 | } |
| 29443 | |
| 29444 | /* Allocate memory of model methods 4 */ |
| 29445 | { |
| 29446 | ssSetModelMethods4(rts, &L4_MABX_M->NonInlinedSFcns.methods4[2]); |
| 29447 | } |
| 29448 | |
| 29449 | /* Allocate memory for states auxilliary information */ |
| 29450 | { |
| 29451 | ssSetStatesInfo2(rts, &L4_MABX_M->NonInlinedSFcns.statesInfo2[2]); |
| 29452 | ssSetPeriodicStatesInfo(rts, |
| 29453 | &L4_MABX_M->NonInlinedSFcns.periodicStatesInfo[2]); |
| 29454 | } |
| 29455 | |
| 29456 | /* outputs */ |
| 29457 | { |
| 29458 | ssSetPortInfoForOutputs(rts, |
| 29459 | &L4_MABX_M->NonInlinedSFcns.Sfcn2.outputPortInfo[0]); |
| 29460 | _ssSetNumOutputPorts(rts, 1); |
| 29461 | _ssSetPortInfo2ForOutputUnits(rts, |
| 29462 | &L4_MABX_M->NonInlinedSFcns.Sfcn2.outputPortUnits[0]); |
| 29463 | ssSetOutputPortUnit(rts, 0, 0); |
| 29464 | _ssSetPortInfo2ForOutputCoSimAttribute(rts, |
| 29465 | &L4_MABX_M->NonInlinedSFcns.Sfcn2.outputPortCoSimAttribute[0]); |
| 29466 | ssSetOutputPortIsContinuousQuantity(rts, 0, 0); |
| 29467 | |
| 29468 | /* port 0 */ |
| 29469 | { |
| 29470 | _ssSetOutputPortNumDimensions(rts, 0, 1); |
| 29471 | ssSetOutputPortWidth(rts, 0, 1); |
| 29472 | ssSetOutputPortSignal(rts, 0, (NULL)); |
| 29473 | } |
| 29474 | } |
| 29475 | |
| 29476 | /* path info */ |
| 29477 | ssSetModelName(rts, "dsa_tcpip_irq_l1_sfcn"); |
| 29478 | ssSetPath(rts, |
| 29479 | "L4_MABX/ETHERNET/TCPIP_Setup/Interrupt_Task/dsa_tcpip_irq_l1_sfcn"); |
| 29480 | ssSetRTModel(rts,L4_MABX_M); |
| 29481 | ssSetParentSS(rts, (NULL)); |
| 29482 | ssSetRootSS(rts, rts); |
| 29483 | ssSetVersion(rts, SIMSTRUCT_VERSION_LEVEL2); |
| 29484 | |
| 29485 | /* register function-calls */ |
| 29486 | { |
| 29487 | int_T *callSysOutputs = (int_T *) |
| 29488 | &L4_MABX_M->NonInlinedSFcns.Sfcn2.callSysOutputs; |
| 29489 | void **callSysArgs1 = (void **) |
| 29490 | &L4_MABX_M->NonInlinedSFcns.Sfcn2.callSysArgs1; |
| 29491 | int_T *callSysArgs2 = (int_T *) |
| 29492 | &L4_MABX_M->NonInlinedSFcns.Sfcn2.callSysArgs2; |
| 29493 | SysOutputFcn *callSysFcns = (SysOutputFcn *) |
| 29494 | &L4_MABX_M->NonInlinedSFcns.Sfcn2.callSysFcns; |
| 29495 | |
| 29496 | { |
| 29497 | int32_T i; |
| 29498 | for (i = 0; i < 1; i++) { |
| 29499 | callSysOutputs[i] = 0; |
| 29500 | callSysFcns[i] = (SysOutputFcn) (NULL); |
| 29501 | callSysFcns[1+i] = (SysOutputFcn) (NULL); |
| 29502 | callSysFcns[2*1+i] = (SysOutputFcn) (NULL); |
| 29503 | callSysFcns[3*1+i] = (SysOutputFcn) (NULL); |
| 29504 | } |
| 29505 | } |
| 29506 | |
| 29507 | ssSetCallSystemOutputPtr(rts, &callSysOutputs[0]); |
| 29508 | ssSetCallSystemOutputArg1List(rts, &callSysArgs1[0]); |
| 29509 | ssSetCallSystemOutputArg2List(rts, &callSysArgs2[0]); |
| 29510 | ssSetCallSystemOutputFcnList(rts, &callSysFcns[0]); |
| 29511 | callSysArgs1[0] = (void *)L4_MABX_M; |
| 29512 | callSysArgs2[0] = 0; |
| 29513 | callSysFcns[0] = (SysOutputFcn) L4_MABX_TcpInputProcessingFNI; |
| 29514 | callSysFcns[1+0] = (SysOutputFcn) L4_TcpInputProcessing_ResetFNI; |
| 29515 | callSysFcns[2+0] = (SysOutputFcn) (NULL); |
| 29516 | callSysFcns[3+0] = (SysOutputFcn) (NULL); |
| 29517 | callSysOutputs[0] = 1; |
| 29518 | } |
| 29519 | |
| 29520 | /* registration */ |
| 29521 | dsa_tcpip_irq_l1_sfcn(rts); |
| 29522 | sfcnInitializeSizes(rts); |
| 29523 | sfcnInitializeSampleTimes(rts); |
| 29524 | |
| 29525 | /* adjust sample time */ |
| 29526 | ssSetSampleTime(rts, 0, -1.0); |
| 29527 | ssSetOffsetTime(rts, 0, -4.0); |
| 29528 | sfcnTsMap[0] = 11; |
| 29529 | |
| 29530 | /* set compiled values of dynamic vector attributes */ |
| 29531 | ssSetOutputPortWidth(rts, 0, 1); |
| 29532 | ssSetNumNonsampledZCs(rts, 0); |
| 29533 | |
| 29534 | /* Update connectivity flags for each port */ |
| 29535 | _ssSetOutputPortConnected(rts, 0, 1); |
| 29536 | _ssSetOutputPortBeingMerged(rts, 0, 0); |
| 29537 | |
| 29538 | /* Update the BufferDstPort flags for each input port */ |
| 29539 | } |
| 29540 | |
| 29541 | /* Level2 S-Function Block: L4_MABX/<S405>/dsa_tcpip_setup (dsa_tcpip_setup_sfcn) */ |
| 29542 | { |
| 29543 | SimStruct *rts = L4_MABX_M->childSfunctions[3]; |
| 29544 | |
| 29545 | /* timing info */ |
| 29546 | time_T *sfcnPeriod = L4_MABX_M->NonInlinedSFcns.Sfcn3.sfcnPeriod; |
| 29547 | time_T *sfcnOffset = L4_MABX_M->NonInlinedSFcns.Sfcn3.sfcnOffset; |
| 29548 | int_T *sfcnTsMap = L4_MABX_M->NonInlinedSFcns.Sfcn3.sfcnTsMap; |
| 29549 | (void) memset((void*)sfcnPeriod, 0, |
| 29550 | sizeof(time_T)*1); |
| 29551 | (void) memset((void*)sfcnOffset, 0, |
| 29552 | sizeof(time_T)*1); |
| 29553 | ssSetSampleTimePtr(rts, &sfcnPeriod[0]); |
| 29554 | ssSetOffsetTimePtr(rts, &sfcnOffset[0]); |
| 29555 | ssSetSampleTimeTaskIDPtr(rts, sfcnTsMap); |
| 29556 | |
| 29557 | { |
| 29558 | ssSetBlkInfo2Ptr(rts, &L4_MABX_M->NonInlinedSFcns.blkInfo2[3]); |
| 29559 | } |
| 29560 | |
| 29561 | _ssSetBlkInfo2PortInfo2Ptr(rts, |
| 29562 | &L4_MABX_M->NonInlinedSFcns.inputOutputPortInfo2[3]); |
| 29563 | |
| 29564 | /* Set up the mdlInfo pointer */ |
| 29565 | ssSetRTWSfcnInfo(rts, L4_MABX_M->sfcnInfo); |
| 29566 | |
| 29567 | /* Allocate memory of model methods 2 */ |
| 29568 | { |
| 29569 | ssSetModelMethods2(rts, &L4_MABX_M->NonInlinedSFcns.methods2[3]); |
| 29570 | } |
| 29571 | |
| 29572 | /* Allocate memory of model methods 3 */ |
| 29573 | { |
| 29574 | ssSetModelMethods3(rts, &L4_MABX_M->NonInlinedSFcns.methods3[3]); |
| 29575 | } |
| 29576 | |
| 29577 | /* Allocate memory of model methods 4 */ |
| 29578 | { |
| 29579 | ssSetModelMethods4(rts, &L4_MABX_M->NonInlinedSFcns.methods4[3]); |
| 29580 | } |
| 29581 | |
| 29582 | /* Allocate memory for states auxilliary information */ |
| 29583 | { |
| 29584 | ssSetStatesInfo2(rts, &L4_MABX_M->NonInlinedSFcns.statesInfo2[3]); |
| 29585 | ssSetPeriodicStatesInfo(rts, |
| 29586 | &L4_MABX_M->NonInlinedSFcns.periodicStatesInfo[3]); |
| 29587 | } |
| 29588 | |
| 29589 | /* outputs */ |
| 29590 | { |
| 29591 | ssSetPortInfoForOutputs(rts, |
| 29592 | &L4_MABX_M->NonInlinedSFcns.Sfcn3.outputPortInfo[0]); |
| 29593 | _ssSetNumOutputPorts(rts, 1); |
| 29594 | _ssSetPortInfo2ForOutputUnits(rts, |
| 29595 | &L4_MABX_M->NonInlinedSFcns.Sfcn3.outputPortUnits[0]); |
| 29596 | ssSetOutputPortUnit(rts, 0, 0); |
| 29597 | _ssSetPortInfo2ForOutputCoSimAttribute(rts, |
| 29598 | &L4_MABX_M->NonInlinedSFcns.Sfcn3.outputPortCoSimAttribute[0]); |
| 29599 | ssSetOutputPortIsContinuousQuantity(rts, 0, 0); |
| 29600 | |
| 29601 | /* port 0 */ |
| 29602 | { |
| 29603 | _ssSetOutputPortNumDimensions(rts, 0, 1); |
| 29604 | ssSetOutputPortWidth(rts, 0, 1); |
| 29605 | ssSetOutputPortSignal(rts, 0, ((real_T *) &EthernetLinkStatus)); |
| 29606 | } |
| 29607 | } |
| 29608 | |
| 29609 | /* path info */ |
| 29610 | ssSetModelName(rts, "dsa_tcpip_setup"); |
| 29611 | ssSetPath(rts, "L4_MABX/ETHERNET/TCPIP_Setup/dsa_tcpip_setup"); |
| 29612 | ssSetRTModel(rts,L4_MABX_M); |
| 29613 | ssSetParentSS(rts, (NULL)); |
| 29614 | ssSetRootSS(rts, rts); |
| 29615 | ssSetVersion(rts, SIMSTRUCT_VERSION_LEVEL2); |
| 29616 | |
| 29617 | /* parameters */ |
| 29618 | { |
| 29619 | mxArray **sfcnParams = (mxArray **) |
| 29620 | &L4_MABX_M->NonInlinedSFcns.Sfcn3.params; |
| 29621 | ssSetSFcnParamsCount(rts, 6); |
| 29622 | ssSetSFcnParamsPtr(rts, &sfcnParams[0]); |
| 29623 | ssSetSFcnParam(rts, 0, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P1_Size); |
| 29624 | ssSetSFcnParam(rts, 1, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P2_Size); |
| 29625 | ssSetSFcnParam(rts, 2, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P3_Size); |
| 29626 | ssSetSFcnParam(rts, 3, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P4_Size); |
| 29627 | ssSetSFcnParam(rts, 4, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P5_Size); |
| 29628 | ssSetSFcnParam(rts, 5, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P6_Size); |
| 29629 | } |
| 29630 | |
| 29631 | /* work vectors */ |
| 29632 | ssSetIWork(rts, (int_T *) &L4_MABX_DW.dsa_tcpip_setup_IWORK); |
| 29633 | ssSetPWork(rts, (void **) &L4_MABX_DW.dsa_tcpip_setup_PWORK); |
| 29634 | |
| 29635 | { |
| 29636 | struct _ssDWorkRecord *dWorkRecord = (struct _ssDWorkRecord *) |
| 29637 | &L4_MABX_M->NonInlinedSFcns.Sfcn3.dWork; |
| 29638 | struct _ssDWorkAuxRecord *dWorkAuxRecord = (struct _ssDWorkAuxRecord *) |
| 29639 | &L4_MABX_M->NonInlinedSFcns.Sfcn3.dWorkAux; |
| 29640 | ssSetSFcnDWork(rts, dWorkRecord); |
| 29641 | ssSetSFcnDWorkAux(rts, dWorkAuxRecord); |
| 29642 | _ssSetNumDWork(rts, 2); |
| 29643 | |
| 29644 | /* IWORK */ |
| 29645 | ssSetDWorkWidth(rts, 0, 1); |
| 29646 | ssSetDWorkDataType(rts, 0,SS_INTEGER); |
| 29647 | ssSetDWorkComplexSignal(rts, 0, 0); |
| 29648 | ssSetDWork(rts, 0, &L4_MABX_DW.dsa_tcpip_setup_IWORK); |
| 29649 | |
| 29650 | /* PWORK */ |
| 29651 | ssSetDWorkWidth(rts, 1, 1); |
| 29652 | ssSetDWorkDataType(rts, 1,SS_POINTER); |
| 29653 | ssSetDWorkComplexSignal(rts, 1, 0); |
| 29654 | ssSetDWork(rts, 1, &L4_MABX_DW.dsa_tcpip_setup_PWORK); |
| 29655 | } |
| 29656 | |
| 29657 | /* registration */ |
| 29658 | dsa_tcpip_setup_sfcn(rts); |
| 29659 | sfcnInitializeSizes(rts); |
| 29660 | sfcnInitializeSampleTimes(rts); |
| 29661 | |
| 29662 | /* adjust sample time */ |
| 29663 | ssSetSampleTime(rts, 0, 0.01); |
| 29664 | ssSetOffsetTime(rts, 0, 0.0); |
| 29665 | sfcnTsMap[0] = 0; |
| 29666 | |
| 29667 | /* set compiled values of dynamic vector attributes */ |
| 29668 | ssSetNumNonsampledZCs(rts, 0); |
| 29669 | |
| 29670 | /* Update connectivity flags for each port */ |
| 29671 | _ssSetOutputPortConnected(rts, 0, 1); |
| 29672 | _ssSetOutputPortBeingMerged(rts, 0, 0); |
| 29673 | |
| 29674 | /* Update the BufferDstPort flags for each input port */ |
| 29675 | } |
| 29676 | |
| 29677 | /* Level2 S-Function Block: L4_MABX/<S406>/TCPIP_Com (dsa_tcpip_udp_sfcn) */ |
| 29678 | { |
| 29679 | SimStruct *rts = L4_MABX_M->childSfunctions[4]; |
| 29680 | |
| 29681 | /* timing info */ |
| 29682 | time_T *sfcnPeriod = L4_MABX_M->NonInlinedSFcns.Sfcn4.sfcnPeriod; |
| 29683 | time_T *sfcnOffset = L4_MABX_M->NonInlinedSFcns.Sfcn4.sfcnOffset; |
| 29684 | int_T *sfcnTsMap = L4_MABX_M->NonInlinedSFcns.Sfcn4.sfcnTsMap; |
| 29685 | (void) memset((void*)sfcnPeriod, 0, |
| 29686 | sizeof(time_T)*1); |
| 29687 | (void) memset((void*)sfcnOffset, 0, |
| 29688 | sizeof(time_T)*1); |
| 29689 | ssSetSampleTimePtr(rts, &sfcnPeriod[0]); |
| 29690 | ssSetOffsetTimePtr(rts, &sfcnOffset[0]); |
| 29691 | ssSetSampleTimeTaskIDPtr(rts, sfcnTsMap); |
| 29692 | |
| 29693 | { |
| 29694 | ssSetBlkInfo2Ptr(rts, &L4_MABX_M->NonInlinedSFcns.blkInfo2[4]); |
| 29695 | } |
| 29696 | |
| 29697 | _ssSetBlkInfo2PortInfo2Ptr(rts, |
| 29698 | &L4_MABX_M->NonInlinedSFcns.inputOutputPortInfo2[4]); |
| 29699 | |
| 29700 | /* Set up the mdlInfo pointer */ |
| 29701 | ssSetRTWSfcnInfo(rts, L4_MABX_M->sfcnInfo); |
| 29702 | |
| 29703 | /* Allocate memory of model methods 2 */ |
| 29704 | { |
| 29705 | ssSetModelMethods2(rts, &L4_MABX_M->NonInlinedSFcns.methods2[4]); |
| 29706 | } |
| 29707 | |
| 29708 | /* Allocate memory of model methods 3 */ |
| 29709 | { |
| 29710 | ssSetModelMethods3(rts, &L4_MABX_M->NonInlinedSFcns.methods3[4]); |
| 29711 | } |
| 29712 | |
| 29713 | /* Allocate memory of model methods 4 */ |
| 29714 | { |
| 29715 | ssSetModelMethods4(rts, &L4_MABX_M->NonInlinedSFcns.methods4[4]); |
| 29716 | } |
| 29717 | |
| 29718 | /* Allocate memory for states auxilliary information */ |
| 29719 | { |
| 29720 | ssSetStatesInfo2(rts, &L4_MABX_M->NonInlinedSFcns.statesInfo2[4]); |
| 29721 | ssSetPeriodicStatesInfo(rts, |
| 29722 | &L4_MABX_M->NonInlinedSFcns.periodicStatesInfo[4]); |
| 29723 | } |
| 29724 | |
| 29725 | /* inputs */ |
| 29726 | { |
| 29727 | _ssSetNumInputPorts(rts, 3); |
| 29728 | ssSetPortInfoForInputs(rts, |
| 29729 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.inputPortInfo[0]); |
| 29730 | _ssSetPortInfo2ForInputUnits(rts, |
| 29731 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.inputPortUnits[0]); |
| 29732 | ssSetInputPortUnit(rts, 0, 0); |
| 29733 | ssSetInputPortUnit(rts, 1, 0); |
| 29734 | ssSetInputPortUnit(rts, 2, 0); |
| 29735 | _ssSetPortInfo2ForInputCoSimAttribute(rts, |
| 29736 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.inputPortCoSimAttribute[0]); |
| 29737 | ssSetInputPortIsContinuousQuantity(rts, 0, 0); |
| 29738 | ssSetInputPortIsContinuousQuantity(rts, 1, 0); |
| 29739 | ssSetInputPortIsContinuousQuantity(rts, 2, 0); |
| 29740 | |
| 29741 | /* port 0 */ |
| 29742 | { |
| 29743 | boolean_T const **sfcnUPtrs = (boolean_T const **) |
| 29744 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.UPtrs0; |
| 29745 | sfcnUPtrs[0] = &L4_MABX_B.Enable; |
| 29746 | ssSetInputPortSignalPtrs(rts, 0, (InputPtrsType)&sfcnUPtrs[0]); |
| 29747 | _ssSetInputPortNumDimensions(rts, 0, 1); |
| 29748 | ssSetInputPortWidth(rts, 0, 1); |
| 29749 | } |
| 29750 | |
| 29751 | /* port 1 */ |
| 29752 | { |
| 29753 | uint32_T const **sfcnUPtrs = (uint32_T const **) |
| 29754 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.UPtrs1; |
| 29755 | sfcnUPtrs[0] = &L4_MABX_B.Encoder_o2; |
| 29756 | ssSetInputPortSignalPtrs(rts, 1, (InputPtrsType)&sfcnUPtrs[0]); |
| 29757 | _ssSetInputPortNumDimensions(rts, 1, 1); |
| 29758 | ssSetInputPortWidth(rts, 1, 1); |
| 29759 | } |
| 29760 | |
| 29761 | /* port 2 */ |
| 29762 | { |
| 29763 | uint8_T const **sfcnUPtrs = (uint8_T const **) |
| 29764 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.UPtrs2; |
| 29765 | |
| 29766 | { |
| 29767 | int_T i1; |
| 29768 | const uint8_T *u2 = L4_MABX_B.Encoder_o1; |
| 29769 | for (i1=0; i1 < 24; i1++) { |
| 29770 | sfcnUPtrs[i1] = &u2[i1]; |
| 29771 | } |
| 29772 | } |
| 29773 | |
| 29774 | ssSetInputPortSignalPtrs(rts, 2, (InputPtrsType)&sfcnUPtrs[0]); |
| 29775 | _ssSetInputPortNumDimensions(rts, 2, 1); |
| 29776 | ssSetInputPortWidth(rts, 2, 24); |
| 29777 | } |
| 29778 | } |
| 29779 | |
| 29780 | /* outputs */ |
| 29781 | { |
| 29782 | ssSetPortInfoForOutputs(rts, |
| 29783 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.outputPortInfo[0]); |
| 29784 | _ssSetNumOutputPorts(rts, 3); |
| 29785 | _ssSetPortInfo2ForOutputUnits(rts, |
| 29786 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.outputPortUnits[0]); |
| 29787 | ssSetOutputPortUnit(rts, 0, 0); |
| 29788 | ssSetOutputPortUnit(rts, 1, 0); |
| 29789 | ssSetOutputPortUnit(rts, 2, 0); |
| 29790 | _ssSetPortInfo2ForOutputCoSimAttribute(rts, |
| 29791 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.outputPortCoSimAttribute[0]); |
| 29792 | ssSetOutputPortIsContinuousQuantity(rts, 0, 0); |
| 29793 | ssSetOutputPortIsContinuousQuantity(rts, 1, 0); |
| 29794 | ssSetOutputPortIsContinuousQuantity(rts, 2, 0); |
| 29795 | |
| 29796 | /* port 0 */ |
| 29797 | { |
| 29798 | _ssSetOutputPortNumDimensions(rts, 0, 1); |
| 29799 | ssSetOutputPortWidth(rts, 0, 3); |
| 29800 | ssSetOutputPortSignal(rts, 0, ((uint32_T *) L4_MABX_B.TCPIP_Com_o1)); |
| 29801 | } |
| 29802 | |
| 29803 | /* port 1 */ |
| 29804 | { |
| 29805 | _ssSetOutputPortNumDimensions(rts, 1, 1); |
| 29806 | ssSetOutputPortWidth(rts, 1, 1); |
| 29807 | ssSetOutputPortSignal(rts, 1, ((uint32_T *) &L4_MABX_B.TCPIP_Com_o2)); |
| 29808 | } |
| 29809 | |
| 29810 | /* port 2 */ |
| 29811 | { |
| 29812 | _ssSetOutputPortNumDimensions(rts, 2, 1); |
| 29813 | ssSetOutputPortWidth(rts, 2, 128); |
| 29814 | ssSetOutputPortSignal(rts, 2, ((uint8_T *) L4_MABX_B.TCPIP_Com_o3)); |
| 29815 | } |
| 29816 | } |
| 29817 | |
| 29818 | /* path info */ |
| 29819 | ssSetModelName(rts, "TCPIP_Com"); |
| 29820 | ssSetPath(rts, "L4_MABX/ETHERNET/UDPIP_Communication/TCPIP_Com"); |
| 29821 | ssSetRTModel(rts,L4_MABX_M); |
| 29822 | ssSetParentSS(rts, (NULL)); |
| 29823 | ssSetRootSS(rts, rts); |
| 29824 | ssSetVersion(rts, SIMSTRUCT_VERSION_LEVEL2); |
| 29825 | |
| 29826 | /* parameters */ |
| 29827 | { |
| 29828 | mxArray **sfcnParams = (mxArray **) |
| 29829 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.params; |
| 29830 | ssSetSFcnParamsCount(rts, 6); |
| 29831 | ssSetSFcnParamsPtr(rts, &sfcnParams[0]); |
| 29832 | ssSetSFcnParam(rts, 0, (mxArray*)L4_MABX_P.TCPIP_Com_P1_Size); |
| 29833 | ssSetSFcnParam(rts, 1, (mxArray*)L4_MABX_P.TCPIP_Com_P2_Size); |
| 29834 | ssSetSFcnParam(rts, 2, (mxArray*)L4_MABX_P.TCPIP_Com_P3_Size); |
| 29835 | ssSetSFcnParam(rts, 3, (mxArray*)L4_MABX_P.TCPIP_Com_P4_Size); |
| 29836 | ssSetSFcnParam(rts, 4, (mxArray*)L4_MABX_P.TCPIP_Com_P5_Size); |
| 29837 | ssSetSFcnParam(rts, 5, (mxArray*)L4_MABX_P.TCPIP_Com_P6_Size); |
| 29838 | } |
| 29839 | |
| 29840 | /* work vectors */ |
| 29841 | ssSetPWork(rts, (void **) &L4_MABX_DW.TCPIP_Com_PWORK); |
| 29842 | |
| 29843 | { |
| 29844 | struct _ssDWorkRecord *dWorkRecord = (struct _ssDWorkRecord *) |
| 29845 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.dWork; |
| 29846 | struct _ssDWorkAuxRecord *dWorkAuxRecord = (struct _ssDWorkAuxRecord *) |
| 29847 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.dWorkAux; |
| 29848 | ssSetSFcnDWork(rts, dWorkRecord); |
| 29849 | ssSetSFcnDWorkAux(rts, dWorkAuxRecord); |
| 29850 | _ssSetNumDWork(rts, 1); |
| 29851 | |
| 29852 | /* PWORK */ |
| 29853 | ssSetDWorkWidth(rts, 0, 1); |
| 29854 | ssSetDWorkDataType(rts, 0,SS_POINTER); |
| 29855 | ssSetDWorkComplexSignal(rts, 0, 0); |
| 29856 | ssSetDWork(rts, 0, &L4_MABX_DW.TCPIP_Com_PWORK); |
| 29857 | } |
| 29858 | |
| 29859 | /* registration */ |
| 29860 | dsa_tcpip_udp_sfcn(rts); |
| 29861 | sfcnInitializeSizes(rts); |
| 29862 | sfcnInitializeSampleTimes(rts); |
| 29863 | |
| 29864 | /* adjust sample time */ |
| 29865 | ssSetSampleTime(rts, 0, 0.01); |
| 29866 | ssSetOffsetTime(rts, 0, 0.0); |
| 29867 | sfcnTsMap[0] = 0; |
| 29868 | |
| 29869 | /* set compiled values of dynamic vector attributes */ |
| 29870 | ssSetNumNonsampledZCs(rts, 0); |
| 29871 | |
| 29872 | /* Update connectivity flags for each port */ |
| 29873 | _ssSetInputPortConnected(rts, 0, 1); |
| 29874 | _ssSetInputPortConnected(rts, 1, 1); |
| 29875 | _ssSetInputPortConnected(rts, 2, 1); |
| 29876 | _ssSetOutputPortConnected(rts, 0, 1); |
| 29877 | _ssSetOutputPortConnected(rts, 1, 1); |
| 29878 | _ssSetOutputPortConnected(rts, 2, 1); |
| 29879 | _ssSetOutputPortBeingMerged(rts, 0, 0); |
| 29880 | _ssSetOutputPortBeingMerged(rts, 1, 0); |
| 29881 | _ssSetOutputPortBeingMerged(rts, 2, 0); |
| 29882 | |
| 29883 | /* Update the BufferDstPort flags for each input port */ |
| 29884 | ssSetInputPortBufferDstPort(rts, 0, -1); |
| 29885 | ssSetInputPortBufferDstPort(rts, 1, -1); |
| 29886 | ssSetInputPortBufferDstPort(rts, 2, -1); |
| 29887 | } |
| 29888 | } |
| 29889 | |
| 29890 | { |
| 29891 | /* user code (registration function declaration) */ |
| 29892 | /*Initialize global TRC pointers. */ |
| 29893 | L4_MABX_rti_init_trc_pointers(); |
| 29894 | } |
| 29895 | |
| 29896 | /* Start for Enabled SubSystem: '<S750>/Slew_at_event' */ |
| 29897 | L4_MABX_DW.Slew_at_event_MODE = false; |
| 29898 | |
| 29899 | /* End of Start for SubSystem: '<S750>/Slew_at_event' */ |
| 29900 | |
| 29901 | /* Start for S-Function (dsa_tcpip_setup_sfcn): '<S405>/dsa_tcpip_setup' */ |
| 29902 | /* Level2 S-Function Block: '<S405>/dsa_tcpip_setup' (dsa_tcpip_setup_sfcn) */ |
| 29903 | { |
| 29904 | SimStruct *rts = L4_MABX_M->childSfunctions[3]; |
| 29905 | sfcnStart(rts); |
| 29906 | if (ssGetErrorStatus(rts) != (NULL)) |
| 29907 | return; |
| 29908 | } |
| 29909 | |
| 29910 | /* Start for Constant: '<S3>/Enable' */ |
| 29911 | L4_MABX_B.Enable = L4_MABX_P.Enable_Value; |
| 29912 | |
| 29913 | /* Start for S-Function (dsa_gen_tx_RTMapsEncode_sfun): '<S413>/Encoder' */ |
| 29914 | Init_Tx_RTMapsEncode(); |
| 29915 | |
| 29916 | /* Start for S-Function (dsa_tcpip_udp_sfcn): '<S406>/TCPIP_Com' */ |
| 29917 | /* Level2 S-Function Block: '<S406>/TCPIP_Com' (dsa_tcpip_udp_sfcn) */ |
| 29918 | { |
| 29919 | SimStruct *rts = L4_MABX_M->childSfunctions[4]; |
| 29920 | sfcnStart(rts); |
| 29921 | if (ssGetErrorStatus(rts) != (NULL)) |
| 29922 | return; |
| 29923 | } |
| 29924 | |
| 29925 | /* Start for S-Function (dsa_gen_rx_RTMapsDecode_sfun): '<S410>/Decoder' */ |
| 29926 | Init_Rx_RTMapsDecode(); |
| 29927 | |
| 29928 | /* Start for Atomic SubSystem: '<S65>/Task_10ms' */ |
| 29929 | /* Start for RateTransition: '<S81>/TmpRTBAtSignal Conversion1Inport1' */ |
| 29930 | L4_MABX_B.distanceSpdTarget_e = L4_MABX_P.TmpRTBAtSignalConversion1Inport; |
| 29931 | |
| 29932 | /* Start for Enabled SubSystem: '<S79>/Throttle_controller_gov' */ |
| 29933 | L4_MABX_DW.Throttle_controller_gov_MODE = false; |
| 29934 | |
| 29935 | /* Start for Enabled SubSystem: '<S244>/Calculate_D_term' */ |
| 29936 | L4_M_Calculate_D_term_Start(&L4_MABX_DW.Calculate_D_term_h); |
| 29937 | |
| 29938 | /* End of Start for SubSystem: '<S244>/Calculate_D_term' */ |
| 29939 | |
| 29940 | /* Start for Enabled SubSystem: '<S244>/Calculate_I_term' */ |
| 29941 | L4_M_Calculate_I_term_Start(&L4_MABX_DW.Calculate_I_term_n); |
| 29942 | |
| 29943 | /* End of Start for SubSystem: '<S244>/Calculate_I_term' */ |
| 29944 | |
| 29945 | /* End of Start for SubSystem: '<S79>/Throttle_controller_gov' */ |
| 29946 | |
| 29947 | /* Start for Enabled SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */ |
| 29948 | L4_MABX_DW.Determine_shift_interlock_brake = false; |
| 29949 | |
| 29950 | /* End of Start for SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */ |
| 29951 | |
| 29952 | /* Start for Enabled SubSystem: '<S105>/Determine_brake_hold_pressure_target' */ |
| 29953 | L4_MABX_DW.Determine_brake_hold_pressure_t = false; |
| 29954 | |
| 29955 | /* End of Start for SubSystem: '<S105>/Determine_brake_hold_pressure_target' */ |
| 29956 | |
| 29957 | /* Start for Enabled SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */ |
| 29958 | L4_MABX_DW.Bendix_2C2_brake_application_pr = false; |
| 29959 | |
| 29960 | /* Start for Enabled SubSystem: '<S112>/Calculate_D_term' */ |
| 29961 | L4_M_Calculate_D_term_Start(&L4_MABX_DW.Calculate_D_term); |
| 29962 | |
| 29963 | /* End of Start for SubSystem: '<S112>/Calculate_D_term' */ |
| 29964 | |
| 29965 | /* Start for Enabled SubSystem: '<S112>/Calculate_I_term' */ |
| 29966 | L4_M_Calculate_I_term_Start(&L4_MABX_DW.Calculate_I_term); |
| 29967 | |
| 29968 | /* End of Start for SubSystem: '<S112>/Calculate_I_term' */ |
| 29969 | |
| 29970 | /* End of Start for SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */ |
| 29971 | |
| 29972 | /* Start for RateTransition: '<S81>/TmpRTBAtSignal Conversion3Inport1' */ |
| 29973 | L4_MABX_B.pathSpdLimit_a = L4_MABX_P.TmpRTBAtSignalConversion3Inport; |
| 29974 | |
| 29975 | /* Start for RateTransition: '<S81>/TmpRTBAtSignal Conversion2Inport1' */ |
| 29976 | L4_MABX_B.distance_o = L4_MABX_P.TmpRTBAtSignalConversion2Inport; |
| 29977 | |
| 29978 | /* Start for Enabled SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */ |
| 29979 | L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba = false; |
| 29980 | |
| 29981 | /* Start for Enabled SubSystem: '<S150>/Calculate_D_term' */ |
| 29982 | L4_M_Calculate_D_term_Start(&L4_MABX_DW.Calculate_D_term_p); |
| 29983 | |
| 29984 | /* End of Start for SubSystem: '<S150>/Calculate_D_term' */ |
| 29985 | |
| 29986 | /* Start for Enabled SubSystem: '<S150>/Calculate_I_term' */ |
| 29987 | L4_M_Calculate_I_term_Start(&L4_MABX_DW.Calculate_I_term_e); |
| 29988 | |
| 29989 | /* End of Start for SubSystem: '<S150>/Calculate_I_term' */ |
| 29990 | |
| 29991 | /* End of Start for SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */ |
| 29992 | |
| 29993 | /* Start for Enabled SubSystem: '<S79>/Engine_speed_target' */ |
| 29994 | L4_MABX_DW.Engine_speed_target_MODE = false; |
| 29995 | |
| 29996 | /* End of Start for SubSystem: '<S79>/Engine_speed_target' */ |
| 29997 | |
| 29998 | /* Start for Enabled SubSystem: '<S283>/Slew_at_event' */ |
| 29999 | L4_MABX_DW.Slew_at_event_MODE_d = false; |
| 30000 | |
| 30001 | /* End of Start for SubSystem: '<S283>/Slew_at_event' */ |
| 30002 | |
| 30003 | /* Start for RateTransition: '<S80>/TmpRTBAtrad2deg1Inport1' */ |
| 30004 | L4_MABX_B.previewSteeringAngle_b = L4_MABX_P.TmpRTBAtrad2deg1Inport1_Initial; |
| 30005 | |
| 30006 | /* Start for RateTransition: '<S80>/TmpRTBAtsignCurveOffsetInport1' */ |
| 30007 | L4_MABX_B.TmpRTBAtsignCurveOffsetInport1 = |
| 30008 | L4_MABX_P.TmpRTBAtsignCurveOffsetInport1_; |
| 30009 | |
| 30010 | /* Start for RateTransition: '<S284>/TmpRTBAtAdd2Inport2' */ |
| 30011 | L4_MABX_B.TmpRTBAtAdd2Inport2 = L4_MABX_P.TmpRTBAtAdd2Inport2_InitialCond; |
| 30012 | |
| 30013 | /* End of Start for SubSystem: '<S65>/Task_10ms' */ |
| 30014 | |
| 30015 | /* Start for Atomic SubSystem: '<S855>/CAN_TX_10ms' */ |
| 30016 | |
| 30017 | /* Start for Width: '<S1012>/Width' */ |
| 30018 | L4_MABX_B.Width_j = 16U; |
| 30019 | |
| 30020 | /* End of Start for SubSystem: '<S855>/CAN_TX_10ms' */ |
| 30021 | |
| 30022 | /* Start for Atomic SubSystem: '<S855>/CAN_TX_20ms' */ |
| 30023 | |
| 30024 | /* Start for Width: '<S1040>/Width' */ |
| 30025 | L4_MABX_B.Width_h = 16U; |
| 30026 | |
| 30027 | /* End of Start for SubSystem: '<S855>/CAN_TX_20ms' */ |
| 30028 | |
| 30029 | /* Start for Atomic SubSystem: '<S855>/CAN_TX_5000ms' */ |
| 30030 | |
| 30031 | /* Start for Width: '<S1055>/Width' */ |
| 30032 | L4_MABX_B.Width = 8U; |
| 30033 | |
| 30034 | /* End of Start for SubSystem: '<S855>/CAN_TX_5000ms' */ |
| 30035 | |
| 30036 | /* Start for RateTransition: '<S1083>/TmpRTBAtFlashOutport1' */ |
| 30037 | L4_MABX_B.TmpRTBAtFlashOutport1 = L4_MABX_P.TmpRTBAtFlashOutport1_InitialCo; |
| 30038 | |
| 30039 | /* Start for Atomic SubSystem: '<S65>/Task_20ms' */ |
| 30040 | /* Start for Constant: '<S402>/InitialHeading' */ |
| 30041 | L4_MABX_B.InitialHeading = L4_MABX_P.InitialHeading_Value; |
| 30042 | |
| 30043 | /* Start for Constant: '<S402>/InitialPosition' */ |
| 30044 | L4_MABX_B.InitialPosition = L4_MABX_P.InitialPosition_Value; |
| 30045 | |
| 30046 | /* Start for Constant: '<S402>/InitialXPosition' */ |
| 30047 | L4_MABX_B.InitialXPosition = L4_MABX_P.InitialXPosition_Value; |
| 30048 | |
| 30049 | /* Start for Constant: '<S402>/InitialYPosition' */ |
| 30050 | L4_MABX_B.InitialYPosition = L4_MABX_P.InitialYPosition_Value; |
| 30051 | |
| 30052 | /* End of Start for SubSystem: '<S65>/Task_20ms' */ |
| 30053 | |
| 30054 | /* Start for S-Function (rti_commonblock): '<S414>/S-Function1' incorporates: |
| 30055 | * SubSystem: '<S405>/Background_Task' |
| 30056 | */ |
| 30057 | L4_MA_Background_Task_Start(); |
| 30058 | |
| 30059 | /* End of Start for S-Function (rti_commonblock): '<S414>/S-Function1' */ |
| 30060 | |
| 30061 | /* Start for S-Function (rti_commonblock): '<S420>/S-Function1' incorporates: |
| 30062 | * SubSystem: '<S405>/Interrupt_Task' |
| 30063 | */ |
| 30064 | L4_MAB_Interrupt_Task_Start(); |
| 30065 | |
| 30066 | /* End of Start for S-Function (rti_commonblock): '<S420>/S-Function1' */ |
| 30067 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C1_Trig_ZCE = UNINITIALIZED_ZCSIG; |
| 30068 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C2_Trig_ZCE = UNINITIALIZED_ZCSIG; |
| 30069 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C1_Trig_ZCE = UNINITIALIZED_ZCSIG; |
| 30070 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C2_Trig_ZCE = UNINITIALIZED_ZCSIG; |
| 30071 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C1_Trig_ZCE = UNINITIALIZED_ZCSIG; |
| 30072 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C2_Trig_ZCE = UNINITIALIZED_ZCSIG; |
| 30073 | L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE_n = POS_ZCSIG; |
| 30074 | L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE = POS_ZCSIG; |
| 30075 | |
| 30076 | { |
| 30077 | int32_T i; |
| 30078 | |
| 30079 | /* InitializeConditions for UnitDelay: '<S763>/Unit Delay' */ |
| 30080 | L4_MABX_DW.UnitDelay_DSTATE = L4_MABX_P.UnitDelay_InitialCondition_e; |
| 30081 | |
| 30082 | /* InitializeConditions for UnitDelay: '<S761>/Delay Input1' */ |
| 30083 | L4_MABX_DW.DelayInput1_DSTATE_i = L4_MABX_P.DetectRisePositive_vinit; |
| 30084 | |
| 30085 | /* InitializeConditions for UnitDelay: '<S762>/Unit Delay' */ |
| 30086 | L4_MABX_DW.UnitDelay_DSTATE_i = L4_MABX_P.UnitDelay_InitialCondition_eu; |
| 30087 | |
| 30088 | /* InitializeConditions for UnitDelay: '<S749>/Unit Delay' */ |
| 30089 | L4_MABX_DW.UnitDelay_DSTATE_ix = L4_MABX_P.UnitDelay_InitialCondition_bf; |
| 30090 | |
| 30091 | /* InitializeConditions for UnitDelay: '<S760>/Delay Input1' */ |
| 30092 | L4_MABX_DW.DelayInput1_DSTATE_i5 = L4_MABX_P.DetectFallNonpositive_vinit_m; |
| 30093 | |
| 30094 | /* InitializeConditions for UnitDelay: '<S762>/Unit Delay1' */ |
| 30095 | L4_MABX_DW.UnitDelay1_DSTATE_p = L4_MABX_P.UnitDelay1_InitialCondition_pw; |
| 30096 | |
| 30097 | /* InitializeConditions for UnitDelay: '<S763>/Unit Delay1' */ |
| 30098 | L4_MABX_DW.UnitDelay1_DSTATE_h = L4_MABX_P.UnitDelay1_InitialCondition_g; |
| 30099 | |
| 30100 | /* InitializeConditions for UnitDelay: '<S802>/FixPt Unit Delay2' */ |
| 30101 | L4_MABX_DW.FixPtUnitDelay2_DSTATE = |
| 30102 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_o; |
| 30103 | |
| 30104 | /* InitializeConditions for UnitDelay: '<S802>/FixPt Unit Delay1' */ |
| 30105 | L4_MABX_DW.FixPtUnitDelay1_DSTATE = |
| 30106 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_e; |
| 30107 | |
| 30108 | /* InitializeConditions for UnitDelay: '<S794>/FixPt Unit Delay2' */ |
| 30109 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_d = |
| 30110 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_i5; |
| 30111 | |
| 30112 | /* InitializeConditions for UnitDelay: '<S794>/FixPt Unit Delay1' */ |
| 30113 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_d = |
| 30114 | L4_MABX_P.FixPtUnitDelay1_InitialCondi_dv; |
| 30115 | |
| 30116 | /* InitializeConditions for UnitDelay: '<S818>/FixPt Unit Delay2' */ |
| 30117 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_a = |
| 30118 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_l; |
| 30119 | |
| 30120 | /* InitializeConditions for UnitDelay: '<S818>/FixPt Unit Delay1' */ |
| 30121 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g = |
| 30122 | L4_MABX_P.FixPtUnitDelay1_InitialCondi_im; |
| 30123 | |
| 30124 | /* InitializeConditions for UnitDelay: '<S810>/FixPt Unit Delay2' */ |
| 30125 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_i = |
| 30126 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_k; |
| 30127 | |
| 30128 | /* InitializeConditions for UnitDelay: '<S810>/FixPt Unit Delay1' */ |
| 30129 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_e = |
| 30130 | L4_MABX_P.FixPtUnitDelay1_InitialCondi_h5; |
| 30131 | |
| 30132 | /* InitializeConditions for UnitDelay: '<S772>/Unit_Delay' */ |
| 30133 | L4_MABX_DW.Unit_Delay_DSTATE_pw = L4_MABX_P.Unit_Delay_InitialCondition_ax; |
| 30134 | |
| 30135 | /* InitializeConditions for UnitDelay: '<S839>/Unit_Delay1' */ |
| 30136 | L4_MABX_DW.Unit_Delay1_DSTATE = L4_MABX_P.Unit_Delay1_InitialCondition_i; |
| 30137 | |
| 30138 | /* InitializeConditions for UnitDelay: '<S839>/Unit_Delay2' */ |
| 30139 | L4_MABX_DW.Unit_Delay2_DSTATE = L4_MABX_P.Unit_Delay2_InitialCondition_d; |
| 30140 | |
| 30141 | /* InitializeConditions for UnitDelay: '<S772>/Unit_Delay1' */ |
| 30142 | L4_MABX_DW.Unit_Delay1_DSTATE_m = L4_MABX_P.Unit_Delay1_InitialCondition_k; |
| 30143 | |
| 30144 | /* InitializeConditions for UnitDelay: '<S840>/Unit_Delay1' */ |
| 30145 | L4_MABX_DW.Unit_Delay1_DSTATE_p = L4_MABX_P.Unit_Delay1_InitialCondition_n; |
| 30146 | |
| 30147 | /* InitializeConditions for UnitDelay: '<S840>/Unit_Delay2' */ |
| 30148 | L4_MABX_DW.Unit_Delay2_DSTATE_g = L4_MABX_P.Unit_Delay2_InitialCondition_i; |
| 30149 | |
| 30150 | /* InitializeConditions for UnitDelay: '<S838>/FixPt Unit Delay2' */ |
| 30151 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_d1 = |
| 30152 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_n; |
| 30153 | |
| 30154 | /* InitializeConditions for UnitDelay: '<S838>/FixPt Unit Delay1' */ |
| 30155 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_n = |
| 30156 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_c; |
| 30157 | |
| 30158 | /* InitializeConditions for UnitDelay: '<S837>/FixPt Unit Delay2' */ |
| 30159 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_g = |
| 30160 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_pj; |
| 30161 | |
| 30162 | /* InitializeConditions for UnitDelay: '<S837>/FixPt Unit Delay1' */ |
| 30163 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_j = |
| 30164 | L4_MABX_P.FixPtUnitDelay1_InitialCondi_fz; |
| 30165 | |
| 30166 | /* InitializeConditions for UnitDelay: '<S826>/FixPt Unit Delay2' */ |
| 30167 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_k = |
| 30168 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_b; |
| 30169 | |
| 30170 | /* InitializeConditions for UnitDelay: '<S826>/FixPt Unit Delay1' */ |
| 30171 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_e5 = |
| 30172 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_a; |
| 30173 | |
| 30174 | /* InitializeConditions for RateTransition: '<S423>/Rate Transition' */ |
| 30175 | L4_MABX_DW.RateTransition_Buffer0 = |
| 30176 | L4_MABX_P.RateTransition_InitialCondition; |
| 30177 | L4_MABX_DW.RateTransition_write_buf = -1; |
| 30178 | L4_MABX_DW.RateTransition_read_buf = -1; |
| 30179 | |
| 30180 | /* InitializeConditions for UnitDelay: '<S655>/Unit_Delay3' */ |
| 30181 | L4_MABX_DW.Unit_Delay3_DSTATE = L4_MABX_P.Unit_Delay3_InitialCondition; |
| 30182 | |
| 30183 | /* InitializeConditions for UnitDelay: '<S655>/Unit_Delay' */ |
| 30184 | L4_MABX_DW.Unit_Delay_DSTATE_h1 = L4_MABX_P.Unit_Delay_InitialCondition_ic; |
| 30185 | |
| 30186 | /* InitializeConditions for UnitDelay: '<S661>/Unit_Delay' */ |
| 30187 | L4_MABX_DW.Unit_Delay_DSTATE_fr = L4_MABX_P.Unit_Delay_InitialCondition_oh; |
| 30188 | |
| 30189 | /* InitializeConditions for S-Function (dsa_tcpip_setup_sfcn): '<S405>/dsa_tcpip_setup' */ |
| 30190 | /* Level2 S-Function Block: '<S405>/dsa_tcpip_setup' (dsa_tcpip_setup_sfcn) */ |
| 30191 | { |
| 30192 | SimStruct *rts = L4_MABX_M->childSfunctions[3]; |
| 30193 | sfcnInitializeConditions(rts); |
| 30194 | if (ssGetErrorStatus(rts) != (NULL)) |
| 30195 | return; |
| 30196 | } |
| 30197 | |
| 30198 | /* InitializeConditions for DiscretePulseGenerator: '<S404>/Heartbeat' */ |
| 30199 | L4_MABX_DW.clockTickCounter = 0; |
| 30200 | |
| 30201 | /* InitializeConditions for UnitDelay: '<S3>/Unit_Delay' */ |
| 30202 | L4_MABX_DW.Unit_Delay_80_DSTATE = L4_MABX_P.Unit_Delay_80_InitialCondition; |
| 30203 | L4_MABX_DW.Unit_Delay_81_DSTATE = L4_MABX_P.Unit_Delay_81_InitialCondition; |
| 30204 | L4_MABX_DW.Unit_Delay_48_DSTATE = L4_MABX_P.Unit_Delay_48_InitialCondition; |
| 30205 | L4_MABX_DW.Unit_Delay_83_DSTATE = L4_MABX_P.Unit_Delay_83_InitialCondition; |
| 30206 | L4_MABX_DW.Unit_Delay_45_DSTATE = L4_MABX_P.Unit_Delay_45_InitialCondition; |
| 30207 | L4_MABX_DW.Unit_Delay_47_DSTATE = L4_MABX_P.Unit_Delay_47_InitialCondition; |
| 30208 | L4_MABX_DW.Unit_Delay_84_DSTATE = L4_MABX_P.Unit_Delay_84_InitialCondition; |
| 30209 | |
| 30210 | /* InitializeConditions for S-Function (dsa_tcpip_udp_sfcn): '<S406>/TCPIP_Com' */ |
| 30211 | /* Level2 S-Function Block: '<S406>/TCPIP_Com' (dsa_tcpip_udp_sfcn) */ |
| 30212 | { |
| 30213 | SimStruct *rts = L4_MABX_M->childSfunctions[4]; |
| 30214 | sfcnInitializeConditions(rts); |
| 30215 | if (ssGetErrorStatus(rts) != (NULL)) |
| 30216 | return; |
| 30217 | } |
| 30218 | |
| 30219 | /* InitializeConditions for UnitDelay: '<S411>/Delay Input1' */ |
| 30220 | L4_MABX_DW.DelayInput1_DSTATE_n = L4_MABX_P.DetectRisePositive1_vinit; |
| 30221 | |
| 30222 | /* InitializeConditions for UnitDelay: '<S409>/Unit Delay' */ |
| 30223 | L4_MABX_DW.UnitDelay_DSTATE_k = L4_MABX_P.UnitDelay_InitialCondition_h; |
| 30224 | |
| 30225 | /* InitializeConditions for UnitDelay: '<S865>/Unit Delay2' */ |
| 30226 | L4_MABX_DW.UnitDelay2_DSTATE = L4_MABX_P.UnitDelay2_InitialCondition; |
| 30227 | |
| 30228 | /* InitializeConditions for UnitDelay: '<S865>/Unit Delay1' */ |
| 30229 | L4_MABX_DW.UnitDelay1_DSTATE_mt = L4_MABX_P.UnitDelay1_InitialCondition_jy; |
| 30230 | |
| 30231 | /* InitializeConditions for UnitDelay: '<S865>/Unit Delay3' */ |
| 30232 | L4_MABX_DW.UnitDelay3_DSTATE = L4_MABX_P.UnitDelay3_InitialCondition; |
| 30233 | |
| 30234 | /* InitializeConditions for RateTransition: '<S1083>/TmpRTBAtFlashOutport1' */ |
| 30235 | L4_MABX_DW.TmpRTBAtFlashOutport1_Buffer0 = |
| 30236 | L4_MABX_P.TmpRTBAtFlashOutport1_InitialCo; |
| 30237 | |
| 30238 | /* InitializeConditions for DiscretePulseGenerator: '<S1083>/Flash' */ |
| 30239 | L4_MABX_DW.clockTickCounter_k = 0; |
| 30240 | |
| 30241 | /* InitializeConditions for UnitDelay: '<S3>/Unit_Delay' */ |
| 30242 | L4_MABX_DW.Unit_Delay_1_DSTATE = L4_MABX_P.Unit_Delay_1_InitialCondition_f; |
| 30243 | L4_MABX_DW.Unit_Delay_10_DSTATE = L4_MABX_P.Unit_Delay_10_InitialCondition; |
| 30244 | L4_MABX_DW.Unit_Delay_100_DSTATE = L4_MABX_P.Unit_Delay_100_InitialCondition; |
| 30245 | L4_MABX_DW.Unit_Delay_101_DSTATE = L4_MABX_P.Unit_Delay_101_InitialCondition; |
| 30246 | L4_MABX_DW.Unit_Delay_102_DSTATE = L4_MABX_P.Unit_Delay_102_InitialCondition; |
| 30247 | L4_MABX_DW.Unit_Delay_103_DSTATE = L4_MABX_P.Unit_Delay_103_InitialCondition; |
| 30248 | L4_MABX_DW.Unit_Delay_104_DSTATE = L4_MABX_P.Unit_Delay_104_InitialCondition; |
| 30249 | L4_MABX_DW.Unit_Delay_105_DSTATE = L4_MABX_P.Unit_Delay_105_InitialCondition; |
| 30250 | L4_MABX_DW.Unit_Delay_106_DSTATE = L4_MABX_P.Unit_Delay_106_InitialCondition; |
| 30251 | L4_MABX_DW.Unit_Delay_107_DSTATE = L4_MABX_P.Unit_Delay_107_InitialCondition; |
| 30252 | L4_MABX_DW.Unit_Delay_108_DSTATE = L4_MABX_P.Unit_Delay_108_InitialCondition; |
| 30253 | L4_MABX_DW.Unit_Delay_109_DSTATE = L4_MABX_P.Unit_Delay_109_InitialCondition; |
| 30254 | L4_MABX_DW.Unit_Delay_11_DSTATE = L4_MABX_P.Unit_Delay_11_InitialCondition; |
| 30255 | L4_MABX_DW.Unit_Delay_110_DSTATE = L4_MABX_P.Unit_Delay_110_InitialCondition; |
| 30256 | L4_MABX_DW.Unit_Delay_111_DSTATE = L4_MABX_P.Unit_Delay_111_InitialCondition; |
| 30257 | L4_MABX_DW.Unit_Delay_112_DSTATE = L4_MABX_P.Unit_Delay_112_InitialCondition; |
| 30258 | L4_MABX_DW.Unit_Delay_113_DSTATE = L4_MABX_P.Unit_Delay_113_InitialCondition; |
| 30259 | L4_MABX_DW.Unit_Delay_114_DSTATE = L4_MABX_P.Unit_Delay_114_InitialCondition; |
| 30260 | L4_MABX_DW.Unit_Delay_115_DSTATE = L4_MABX_P.Unit_Delay_115_InitialCondition; |
| 30261 | L4_MABX_DW.Unit_Delay_116_DSTATE = L4_MABX_P.Unit_Delay_116_InitialCondition; |
| 30262 | L4_MABX_DW.Unit_Delay_117_DSTATE = L4_MABX_P.Unit_Delay_117_InitialCondition; |
| 30263 | L4_MABX_DW.Unit_Delay_118_DSTATE = L4_MABX_P.Unit_Delay_118_InitialCondition; |
| 30264 | L4_MABX_DW.Unit_Delay_119_DSTATE = L4_MABX_P.Unit_Delay_119_InitialCondition; |
| 30265 | L4_MABX_DW.Unit_Delay_12_DSTATE = L4_MABX_P.Unit_Delay_12_InitialCondition; |
| 30266 | L4_MABX_DW.Unit_Delay_120_DSTATE = L4_MABX_P.Unit_Delay_120_InitialCondition; |
| 30267 | L4_MABX_DW.Unit_Delay_121_DSTATE = L4_MABX_P.Unit_Delay_121_InitialCondition; |
| 30268 | L4_MABX_DW.Unit_Delay_122_DSTATE = L4_MABX_P.Unit_Delay_122_InitialCondition; |
| 30269 | L4_MABX_DW.Unit_Delay_123_DSTATE = L4_MABX_P.Unit_Delay_123_InitialCondition; |
| 30270 | L4_MABX_DW.Unit_Delay_124_DSTATE = L4_MABX_P.Unit_Delay_124_InitialCondition; |
| 30271 | L4_MABX_DW.Unit_Delay_125_DSTATE = L4_MABX_P.Unit_Delay_125_InitialCondition; |
| 30272 | L4_MABX_DW.Unit_Delay_126_DSTATE = L4_MABX_P.Unit_Delay_126_InitialCondition; |
| 30273 | L4_MABX_DW.Unit_Delay_127_DSTATE = L4_MABX_P.Unit_Delay_127_InitialCondition; |
| 30274 | L4_MABX_DW.Unit_Delay_128_DSTATE = L4_MABX_P.Unit_Delay_128_InitialCondition; |
| 30275 | L4_MABX_DW.Unit_Delay_129_DSTATE = L4_MABX_P.Unit_Delay_129_InitialCondition; |
| 30276 | L4_MABX_DW.Unit_Delay_13_DSTATE = L4_MABX_P.Unit_Delay_13_InitialCondition; |
| 30277 | L4_MABX_DW.Unit_Delay_130_DSTATE = L4_MABX_P.Unit_Delay_130_InitialCondition; |
| 30278 | L4_MABX_DW.Unit_Delay_131_DSTATE = L4_MABX_P.Unit_Delay_131_InitialCondition; |
| 30279 | L4_MABX_DW.Unit_Delay_132_DSTATE = L4_MABX_P.Unit_Delay_132_InitialCondition; |
| 30280 | L4_MABX_DW.Unit_Delay_133_DSTATE = L4_MABX_P.Unit_Delay_133_InitialCondition; |
| 30281 | L4_MABX_DW.Unit_Delay_134_DSTATE = L4_MABX_P.Unit_Delay_134_InitialCondition; |
| 30282 | L4_MABX_DW.Unit_Delay_135_DSTATE = L4_MABX_P.Unit_Delay_135_InitialCondition; |
| 30283 | L4_MABX_DW.Unit_Delay_136_DSTATE = L4_MABX_P.Unit_Delay_136_InitialCondition; |
| 30284 | L4_MABX_DW.Unit_Delay_137_DSTATE = L4_MABX_P.Unit_Delay_137_InitialCondition; |
| 30285 | L4_MABX_DW.Unit_Delay_138_DSTATE = L4_MABX_P.Unit_Delay_138_InitialCondition; |
| 30286 | L4_MABX_DW.Unit_Delay_139_DSTATE = L4_MABX_P.Unit_Delay_139_InitialCondition; |
| 30287 | L4_MABX_DW.Unit_Delay_14_DSTATE = L4_MABX_P.Unit_Delay_14_InitialCondition; |
| 30288 | L4_MABX_DW.Unit_Delay_140_DSTATE = L4_MABX_P.Unit_Delay_140_InitialCondition; |
| 30289 | L4_MABX_DW.Unit_Delay_141_DSTATE = L4_MABX_P.Unit_Delay_141_InitialCondition; |
| 30290 | L4_MABX_DW.Unit_Delay_142_DSTATE = L4_MABX_P.Unit_Delay_142_InitialCondition; |
| 30291 | L4_MABX_DW.Unit_Delay_143_DSTATE = L4_MABX_P.Unit_Delay_143_InitialCondition; |
| 30292 | L4_MABX_DW.Unit_Delay_144_DSTATE = L4_MABX_P.Unit_Delay_144_InitialCondition; |
| 30293 | L4_MABX_DW.Unit_Delay_15_DSTATE = L4_MABX_P.Unit_Delay_15_InitialCondition; |
| 30294 | L4_MABX_DW.Unit_Delay_16_DSTATE = L4_MABX_P.Unit_Delay_16_InitialCondition; |
| 30295 | L4_MABX_DW.Unit_Delay_17_DSTATE = L4_MABX_P.Unit_Delay_17_InitialCondition; |
| 30296 | L4_MABX_DW.Unit_Delay_18_DSTATE = L4_MABX_P.Unit_Delay_18_InitialCondition; |
| 30297 | L4_MABX_DW.Unit_Delay_19_DSTATE = L4_MABX_P.Unit_Delay_19_InitialCondition; |
| 30298 | L4_MABX_DW.Unit_Delay_2_DSTATE = L4_MABX_P.Unit_Delay_2_InitialCondition_f; |
| 30299 | L4_MABX_DW.Unit_Delay_20_DSTATE = L4_MABX_P.Unit_Delay_20_InitialCondition; |
| 30300 | L4_MABX_DW.Unit_Delay_21_DSTATE = L4_MABX_P.Unit_Delay_21_InitialCondition; |
| 30301 | L4_MABX_DW.Unit_Delay_22_DSTATE = L4_MABX_P.Unit_Delay_22_InitialCondition; |
| 30302 | L4_MABX_DW.Unit_Delay_23_DSTATE = L4_MABX_P.Unit_Delay_23_InitialCondition; |
| 30303 | L4_MABX_DW.Unit_Delay_24_DSTATE = L4_MABX_P.Unit_Delay_24_InitialCondition; |
| 30304 | L4_MABX_DW.Unit_Delay_25_DSTATE = L4_MABX_P.Unit_Delay_25_InitialCondition; |
| 30305 | L4_MABX_DW.Unit_Delay_26_DSTATE = L4_MABX_P.Unit_Delay_26_InitialCondition; |
| 30306 | L4_MABX_DW.Unit_Delay_27_DSTATE = L4_MABX_P.Unit_Delay_27_InitialCondition; |
| 30307 | L4_MABX_DW.Unit_Delay_28_DSTATE = L4_MABX_P.Unit_Delay_28_InitialCondition; |
| 30308 | L4_MABX_DW.Unit_Delay_29_DSTATE = L4_MABX_P.Unit_Delay_29_InitialCondition; |
| 30309 | L4_MABX_DW.Unit_Delay_3_DSTATE = L4_MABX_P.Unit_Delay_3_InitialCondition_f; |
| 30310 | L4_MABX_DW.Unit_Delay_30_DSTATE = L4_MABX_P.Unit_Delay_30_InitialCondition; |
| 30311 | L4_MABX_DW.Unit_Delay_31_DSTATE = L4_MABX_P.Unit_Delay_31_InitialCondition; |
| 30312 | L4_MABX_DW.Unit_Delay_32_DSTATE = L4_MABX_P.Unit_Delay_32_InitialCondition; |
| 30313 | L4_MABX_DW.Unit_Delay_33_DSTATE = L4_MABX_P.Unit_Delay_33_InitialCondition; |
| 30314 | L4_MABX_DW.Unit_Delay_34_DSTATE = L4_MABX_P.Unit_Delay_34_InitialCondition; |
| 30315 | L4_MABX_DW.Unit_Delay_35_DSTATE = L4_MABX_P.Unit_Delay_35_InitialCondition; |
| 30316 | L4_MABX_DW.Unit_Delay_36_DSTATE = L4_MABX_P.Unit_Delay_36_InitialCondition; |
| 30317 | L4_MABX_DW.Unit_Delay_37_DSTATE = L4_MABX_P.Unit_Delay_37_InitialCondition; |
| 30318 | L4_MABX_DW.Unit_Delay_38_DSTATE = L4_MABX_P.Unit_Delay_38_InitialCondition; |
| 30319 | L4_MABX_DW.Unit_Delay_39_DSTATE = L4_MABX_P.Unit_Delay_39_InitialCondition; |
| 30320 | L4_MABX_DW.Unit_Delay_4_DSTATE = L4_MABX_P.Unit_Delay_4_InitialCondition; |
| 30321 | L4_MABX_DW.Unit_Delay_40_DSTATE = L4_MABX_P.Unit_Delay_40_InitialCondition; |
| 30322 | L4_MABX_DW.Unit_Delay_41_DSTATE = L4_MABX_P.Unit_Delay_41_InitialCondition; |
| 30323 | L4_MABX_DW.Unit_Delay_42_DSTATE = L4_MABX_P.Unit_Delay_42_InitialCondition; |
| 30324 | L4_MABX_DW.Unit_Delay_43_DSTATE = L4_MABX_P.Unit_Delay_43_InitialCondition; |
| 30325 | L4_MABX_DW.Unit_Delay_44_DSTATE = L4_MABX_P.Unit_Delay_44_InitialCondition; |
| 30326 | L4_MABX_DW.Unit_Delay_46_DSTATE = L4_MABX_P.Unit_Delay_46_InitialCondition; |
| 30327 | L4_MABX_DW.Unit_Delay_49_DSTATE = L4_MABX_P.Unit_Delay_49_InitialCondition; |
| 30328 | L4_MABX_DW.Unit_Delay_5_DSTATE = L4_MABX_P.Unit_Delay_5_InitialCondition; |
| 30329 | L4_MABX_DW.Unit_Delay_50_DSTATE = L4_MABX_P.Unit_Delay_50_InitialCondition; |
| 30330 | L4_MABX_DW.Unit_Delay_51_DSTATE = L4_MABX_P.Unit_Delay_51_InitialCondition; |
| 30331 | L4_MABX_DW.Unit_Delay_52_DSTATE = L4_MABX_P.Unit_Delay_52_InitialCondition; |
| 30332 | L4_MABX_DW.Unit_Delay_53_DSTATE = L4_MABX_P.Unit_Delay_53_InitialCondition; |
| 30333 | L4_MABX_DW.Unit_Delay_54_DSTATE = L4_MABX_P.Unit_Delay_54_InitialCondition; |
| 30334 | L4_MABX_DW.Unit_Delay_55_DSTATE = L4_MABX_P.Unit_Delay_55_InitialCondition; |
| 30335 | L4_MABX_DW.Unit_Delay_56_DSTATE = L4_MABX_P.Unit_Delay_56_InitialCondition; |
| 30336 | L4_MABX_DW.Unit_Delay_57_DSTATE = L4_MABX_P.Unit_Delay_57_InitialCondition; |
| 30337 | L4_MABX_DW.Unit_Delay_58_DSTATE = L4_MABX_P.Unit_Delay_58_InitialCondition; |
| 30338 | L4_MABX_DW.Unit_Delay_59_DSTATE = L4_MABX_P.Unit_Delay_59_InitialCondition; |
| 30339 | L4_MABX_DW.Unit_Delay_6_DSTATE = L4_MABX_P.Unit_Delay_6_InitialCondition; |
| 30340 | L4_MABX_DW.Unit_Delay_60_DSTATE = L4_MABX_P.Unit_Delay_60_InitialCondition; |
| 30341 | L4_MABX_DW.Unit_Delay_61_DSTATE = L4_MABX_P.Unit_Delay_61_InitialCondition; |
| 30342 | L4_MABX_DW.Unit_Delay_62_DSTATE = L4_MABX_P.Unit_Delay_62_InitialCondition; |
| 30343 | L4_MABX_DW.Unit_Delay_63_DSTATE = L4_MABX_P.Unit_Delay_63_InitialCondition; |
| 30344 | L4_MABX_DW.Unit_Delay_64_DSTATE = L4_MABX_P.Unit_Delay_64_InitialCondition; |
| 30345 | L4_MABX_DW.Unit_Delay_65_DSTATE = L4_MABX_P.Unit_Delay_65_InitialCondition; |
| 30346 | L4_MABX_DW.Unit_Delay_66_DSTATE = L4_MABX_P.Unit_Delay_66_InitialCondition; |
| 30347 | L4_MABX_DW.Unit_Delay_67_DSTATE = L4_MABX_P.Unit_Delay_67_InitialCondition; |
| 30348 | L4_MABX_DW.Unit_Delay_68_DSTATE = L4_MABX_P.Unit_Delay_68_InitialCondition; |
| 30349 | L4_MABX_DW.Unit_Delay_69_DSTATE = L4_MABX_P.Unit_Delay_69_InitialCondition; |
| 30350 | L4_MABX_DW.Unit_Delay_7_DSTATE = L4_MABX_P.Unit_Delay_7_InitialCondition; |
| 30351 | L4_MABX_DW.Unit_Delay_70_DSTATE = L4_MABX_P.Unit_Delay_70_InitialCondition; |
| 30352 | L4_MABX_DW.Unit_Delay_71_DSTATE = L4_MABX_P.Unit_Delay_71_InitialCondition; |
| 30353 | L4_MABX_DW.Unit_Delay_72_DSTATE = L4_MABX_P.Unit_Delay_72_InitialCondition; |
| 30354 | L4_MABX_DW.Unit_Delay_73_DSTATE = L4_MABX_P.Unit_Delay_73_InitialCondition; |
| 30355 | L4_MABX_DW.Unit_Delay_74_DSTATE = L4_MABX_P.Unit_Delay_74_InitialCondition; |
| 30356 | L4_MABX_DW.Unit_Delay_75_DSTATE = L4_MABX_P.Unit_Delay_75_InitialCondition; |
| 30357 | L4_MABX_DW.Unit_Delay_76_DSTATE = L4_MABX_P.Unit_Delay_76_InitialCondition; |
| 30358 | L4_MABX_DW.Unit_Delay_77_DSTATE = L4_MABX_P.Unit_Delay_77_InitialCondition; |
| 30359 | L4_MABX_DW.Unit_Delay_78_DSTATE = L4_MABX_P.Unit_Delay_78_InitialCondition; |
| 30360 | L4_MABX_DW.Unit_Delay_79_DSTATE = L4_MABX_P.Unit_Delay_79_InitialCondition; |
| 30361 | L4_MABX_DW.Unit_Delay_8_DSTATE = L4_MABX_P.Unit_Delay_8_InitialCondition; |
| 30362 | L4_MABX_DW.Unit_Delay_82_DSTATE = L4_MABX_P.Unit_Delay_82_InitialCondition; |
| 30363 | L4_MABX_DW.Unit_Delay_85_DSTATE = L4_MABX_P.Unit_Delay_85_InitialCondition; |
| 30364 | L4_MABX_DW.Unit_Delay_86_DSTATE = L4_MABX_P.Unit_Delay_86_InitialCondition; |
| 30365 | L4_MABX_DW.Unit_Delay_87_DSTATE = L4_MABX_P.Unit_Delay_87_InitialCondition; |
| 30366 | L4_MABX_DW.Unit_Delay_88_DSTATE = L4_MABX_P.Unit_Delay_88_InitialCondition; |
| 30367 | L4_MABX_DW.Unit_Delay_89_DSTATE = L4_MABX_P.Unit_Delay_89_InitialCondition; |
| 30368 | L4_MABX_DW.Unit_Delay_9_DSTATE = L4_MABX_P.Unit_Delay_9_InitialCondition; |
| 30369 | L4_MABX_DW.Unit_Delay_90_DSTATE = L4_MABX_P.Unit_Delay_90_InitialCondition; |
| 30370 | L4_MABX_DW.Unit_Delay_91_DSTATE = L4_MABX_P.Unit_Delay_91_InitialCondition; |
| 30371 | L4_MABX_DW.Unit_Delay_92_DSTATE = L4_MABX_P.Unit_Delay_92_InitialCondition; |
| 30372 | L4_MABX_DW.Unit_Delay_93_DSTATE = L4_MABX_P.Unit_Delay_93_InitialCondition; |
| 30373 | L4_MABX_DW.Unit_Delay_94_DSTATE = L4_MABX_P.Unit_Delay_94_InitialCondition; |
| 30374 | L4_MABX_DW.Unit_Delay_95_DSTATE = L4_MABX_P.Unit_Delay_95_InitialCondition; |
| 30375 | L4_MABX_DW.Unit_Delay_96_DSTATE = L4_MABX_P.Unit_Delay_96_InitialCondition; |
| 30376 | L4_MABX_DW.Unit_Delay_97_DSTATE = L4_MABX_P.Unit_Delay_97_InitialCondition; |
| 30377 | L4_MABX_DW.Unit_Delay_98_DSTATE = L4_MABX_P.Unit_Delay_98_InitialCondition; |
| 30378 | L4_MABX_DW.Unit_Delay_99_DSTATE = L4_MABX_P.Unit_Delay_99_InitialCondition; |
| 30379 | |
| 30380 | /* InitializeConditions for UnitDelay: '<S655>/Unit_Delay2' */ |
| 30381 | L4_MABX_DW.Unit_Delay2_DSTATE_p1 = L4_MABX_P.Unit_Delay2_InitialCondition_m; |
| 30382 | |
| 30383 | /* InitializeConditions for UnitDelay: '<S655>/Unit_Delay1' */ |
| 30384 | L4_MABX_DW.Unit_Delay1_DSTATE_d = L4_MABX_P.Unit_Delay1_InitialCondition_e; |
| 30385 | |
| 30386 | /* InitializeConditions for UnitDelay: '<S662>/Unit_Delay' */ |
| 30387 | L4_MABX_DW.Unit_Delay_DSTATE_iv = L4_MABX_P.Unit_Delay_InitialCondition_ki; |
| 30388 | |
| 30389 | /* InitializeConditions for UnitDelay: '<S753>/Delay Input1' */ |
| 30390 | L4_MABX_DW.DelayInput1_DSTATE_l = L4_MABX_P.DetectRisePositive_vinit_f; |
| 30391 | |
| 30392 | /* InitializeConditions for UnitDelay: '<S754>/Unit Delay' */ |
| 30393 | L4_MABX_DW.UnitDelay_DSTATE_j = L4_MABX_P.UnitDelay_InitialCondition_i; |
| 30394 | |
| 30395 | /* InitializeConditions for UnitDelay: '<S748>/Unit Delay' */ |
| 30396 | L4_MABX_DW.UnitDelay_DSTATE_cq = L4_MABX_P.UnitDelay_InitialCondition_gz; |
| 30397 | |
| 30398 | /* InitializeConditions for UnitDelay: '<S752>/Delay Input1' */ |
| 30399 | L4_MABX_DW.DelayInput1_DSTATE_c = L4_MABX_P.DetectFallNonpositive_vinit_n; |
| 30400 | |
| 30401 | /* InitializeConditions for UnitDelay: '<S754>/Unit Delay1' */ |
| 30402 | L4_MABX_DW.UnitDelay1_DSTATE_n = L4_MABX_P.UnitDelay1_InitialCondition_pa; |
| 30403 | |
| 30404 | /* InitializeConditions for UnitDelay: '<S755>/Unit Delay' */ |
| 30405 | L4_MABX_DW.UnitDelay_DSTATE_is = L4_MABX_P.UnitDelay_InitialCondition_n; |
| 30406 | |
| 30407 | /* InitializeConditions for UnitDelay: '<S755>/Unit Delay1' */ |
| 30408 | L4_MABX_DW.UnitDelay1_DSTATE_pn = L4_MABX_P.UnitDelay1_InitialCondition_c; |
| 30409 | |
| 30410 | /* InitializeConditions for UnitDelay: '<S10>/Unit_Delay' */ |
| 30411 | L4_MABX_DW.Unit_Delay_DSTATE_do = L4_MABX_P.Unit_Delay_InitialCondition_jp; |
| 30412 | |
| 30413 | /* SystemInitialize for Enabled SubSystem: '<S503>/AIR1' */ |
| 30414 | /* SystemInitialize for Outport: '<S504>/PneumaticSupplyPress' */ |
| 30415 | L4_MABX_B.SFunction1_o1_fw = L4_MABX_P.PneumaticSupplyPress_Y0; |
| 30416 | |
| 30417 | /* SystemInitialize for Outport: '<S504>/ParkingAnd_orTrailerAirPress' */ |
| 30418 | L4_MABX_B.SFunction1_o2_ey = L4_MABX_P.ParkingAnd_orTrailerAirPress_Y0; |
| 30419 | |
| 30420 | /* SystemInitialize for Outport: '<S504>/ServiceBrakeCircuit1AirPress' */ |
| 30421 | L4_MABX_B.SFunction1_o3_j1 = L4_MABX_P.ServiceBrakeCircuit1AirPress_Y0; |
| 30422 | |
| 30423 | /* SystemInitialize for Outport: '<S504>/ServiceBrakeCircuit2AirPress' */ |
| 30424 | L4_MABX_B.SFunction1_o4_kv = L4_MABX_P.ServiceBrakeCircuit2AirPress_Y0; |
| 30425 | |
| 30426 | /* SystemInitialize for Outport: '<S504>/AuxEquipmentSupplyPress' */ |
| 30427 | L4_MABX_B.SFunction1_o5_ki = L4_MABX_P.AuxEquipmentSupplyPress_Y0; |
| 30428 | |
| 30429 | /* SystemInitialize for Outport: '<S504>/AirSuspensionSupplyPress' */ |
| 30430 | L4_MABX_B.SFunction1_o6_jl = L4_MABX_P.AirSuspensionSupplyPress_Y0; |
| 30431 | |
| 30432 | /* SystemInitialize for Outport: '<S504>/AirCompressorStatus' */ |
| 30433 | L4_MABX_B.SFunction1_o7_hj = L4_MABX_P.AirCompressorStatus_Y0; |
| 30434 | |
| 30435 | /* SystemInitialize for Outport: '<S504>/PowertrainCircuitAirSupplyPress' */ |
| 30436 | L4_MABX_B.SFunction1_o8_fg = L4_MABX_P.PowertrainCircuitAirSupplyPress; |
| 30437 | |
| 30438 | /* SystemInitialize for Outport: '<S504>/RX status' */ |
| 30439 | L4_MABX_B.SFunction1_o9_kh = L4_MABX_P.RXstatus_Y0_l; |
| 30440 | |
| 30441 | /* SystemInitialize for Outport: '<S504>/RX time' */ |
| 30442 | L4_MABX_B.SFunction1_o10_dt = L4_MABX_P.RXtime_Y0_n5b; |
| 30443 | |
| 30444 | /* SystemInitialize for Outport: '<S504>/RX delta time' */ |
| 30445 | L4_MABX_B.SFunction1_o11_a3 = L4_MABX_P.RXdeltatime_Y0_p; |
| 30446 | |
| 30447 | /* End of SystemInitialize for SubSystem: '<S503>/AIR1' */ |
| 30448 | |
| 30449 | /* SystemInitialize for Enabled SubSystem: '<S505>/AMB' */ |
| 30450 | /* SystemInitialize for Outport: '<S506>/BarometricPress' */ |
| 30451 | L4_MABX_B.SFunction1_o1_a5 = L4_MABX_P.BarometricPress_Y0; |
| 30452 | |
| 30453 | /* SystemInitialize for Outport: '<S506>/CabInteriorTemp' */ |
| 30454 | L4_MABX_B.SFunction1_o2_f2 = L4_MABX_P.CabInteriorTemp_Y0; |
| 30455 | |
| 30456 | /* SystemInitialize for Outport: '<S506>/AmbientAirTemp' */ |
| 30457 | L4_MABX_B.SFunction1_o3_fp = L4_MABX_P.AmbientAirTemp_Y0; |
| 30458 | |
| 30459 | /* SystemInitialize for Outport: '<S506>/EngAirIntakeTemp' */ |
| 30460 | L4_MABX_B.SFunction1_o4_i0 = L4_MABX_P.EngAirIntakeTemp_Y0; |
| 30461 | |
| 30462 | /* SystemInitialize for Outport: '<S506>/RoadSurfaceTemp' */ |
| 30463 | L4_MABX_B.SFunction1_o5_gk = L4_MABX_P.RoadSurfaceTemp_Y0; |
| 30464 | |
| 30465 | /* SystemInitialize for Outport: '<S506>/RX status' */ |
| 30466 | L4_MABX_B.SFunction1_o6_j0 = L4_MABX_P.RXstatus_Y0_f; |
| 30467 | |
| 30468 | /* SystemInitialize for Outport: '<S506>/RX time' */ |
| 30469 | L4_MABX_B.SFunction1_o7_m = L4_MABX_P.RXtime_Y0_i; |
| 30470 | |
| 30471 | /* SystemInitialize for Outport: '<S506>/RX delta time' */ |
| 30472 | L4_MABX_B.SFunction1_o8_i = L4_MABX_P.RXdeltatime_Y0_ez; |
| 30473 | |
| 30474 | /* End of SystemInitialize for SubSystem: '<S505>/AMB' */ |
| 30475 | |
| 30476 | /* SystemInitialize for Atomic SubSystem: '<S855>/CAN_TX_1000ms' */ |
| 30477 | /* SystemInitialize for Enabled SubSystem: '<S875>/AIR1' */ |
| 30478 | /* SystemInitialize for Outport: '<S876>/TX status' */ |
| 30479 | L4_MABX_B.SFunction1_o1_bs = L4_MABX_P.TXstatus_Y0; |
| 30480 | |
| 30481 | /* SystemInitialize for Outport: '<S876>/TX time' */ |
| 30482 | L4_MABX_B.SFunction1_o2_ad = L4_MABX_P.TXtime_Y0; |
| 30483 | |
| 30484 | /* SystemInitialize for Outport: '<S876>/TX delta time' */ |
| 30485 | L4_MABX_B.SFunction1_o3_dz = L4_MABX_P.TXdeltatime_Y0; |
| 30486 | |
| 30487 | /* SystemInitialize for Outport: '<S876>/TX delay time' */ |
| 30488 | L4_MABX_B.SFunction1_o4_hw = L4_MABX_P.TXdelaytime_Y0; |
| 30489 | |
| 30490 | /* End of SystemInitialize for SubSystem: '<S875>/AIR1' */ |
| 30491 | |
| 30492 | /* SystemInitialize for Enabled SubSystem: '<S883>/AMB' */ |
| 30493 | /* SystemInitialize for Outport: '<S884>/TX status' */ |
| 30494 | L4_MABX_B.SFunction1_o1_lt = L4_MABX_P.TXstatus_Y0_k; |
| 30495 | |
| 30496 | /* SystemInitialize for Outport: '<S884>/TX time' */ |
| 30497 | L4_MABX_B.SFunction1_o2_n = L4_MABX_P.TXtime_Y0_c; |
| 30498 | |
| 30499 | /* SystemInitialize for Outport: '<S884>/TX delta time' */ |
| 30500 | L4_MABX_B.SFunction1_o3_ea = L4_MABX_P.TXdeltatime_Y0_i; |
| 30501 | |
| 30502 | /* SystemInitialize for Outport: '<S884>/TX delay time' */ |
| 30503 | L4_MABX_B.SFunction1_o4_d0 = L4_MABX_P.TXdelaytime_Y0_g; |
| 30504 | |
| 30505 | /* End of SystemInitialize for SubSystem: '<S883>/AMB' */ |
| 30506 | /* End of SystemInitialize for SubSystem: '<S855>/CAN_TX_1000ms' */ |
| 30507 | |
| 30508 | /* SystemInitialize for Chart: '<S851>/Chart' */ |
| 30509 | L4_MABX_DW.is_active_c5_SUB_ECU_L4_MABX_HW = 0U; |
| 30510 | L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 30511 | |
| 30512 | /* SystemInitialize for Chart: '<S769>/Health State Machine PWM Sensor 1' */ |
| 30513 | L4_MABX_DW.is_FAILURE_DETECTED_b = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 30514 | L4_MABX_DW.is_active_c9_SUB_ECU_L4_MABX_HW = 0U; |
| 30515 | L4_MABX_DW.is_c9_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 30516 | |
| 30517 | /* SystemInitialize for Chart: '<S769>/Health State Machine PWM Sensor 2' */ |
| 30518 | L4_MABX_DW.is_FAILURE_DETECTED = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 30519 | L4_MABX_DW.is_active_c10_SUB_ECU_L4_MABX_H = 0U; |
| 30520 | L4_MABX_DW.is_c10_SUB_ECU_L4_MABX_HW_Inter = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 30521 | |
| 30522 | /* SystemInitialize for Enabled SubSystem: '<S750>/Slew_at_event' */ |
| 30523 | /* InitializeConditions for UnitDelay: '<S844>/Unit_Delay' */ |
| 30524 | L4_MABX_DW.Unit_Delay_DSTATE_jr = L4_MABX_P.Unit_Delay_InitialCondition_e2j; |
| 30525 | |
| 30526 | /* InitializeConditions for UnitDelay: '<S845>/Unit_Delay' */ |
| 30527 | L4_MABX_DW.Unit_Delay_DSTATE_jz = L4_MABX_P.Unit_Delay_InitialCondition_g1; |
| 30528 | |
| 30529 | /* InitializeConditions for UnitDelay: '<S848>/FixPt Unit Delay2' */ |
| 30530 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_b = |
| 30531 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_a4; |
| 30532 | |
| 30533 | /* InitializeConditions for UnitDelay: '<S848>/FixPt Unit Delay1' */ |
| 30534 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_o = |
| 30535 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_i; |
| 30536 | |
| 30537 | /* InitializeConditions for UnitDelay: '<S843>/Unit_Delay' */ |
| 30538 | L4_MABX_DW.Unit_Delay_DSTATE_hg = L4_MABX_P.Unit_Delay_InitialCondition_nk; |
| 30539 | |
| 30540 | /* SystemInitialize for Outport: '<S773>/F_Out_slewing' */ |
| 30541 | L4_MABX_B.LogicalOperator_np = L4_MABX_P.F_Out_slewing_Y0_a; |
| 30542 | |
| 30543 | /* SystemInitialize for Outport: '<S773>/Out' */ |
| 30544 | L4_MABX_B.If_Then_Else_or.Switch = L4_MABX_P.Out_Y0_h; |
| 30545 | |
| 30546 | /* End of SystemInitialize for SubSystem: '<S750>/Slew_at_event' */ |
| 30547 | |
| 30548 | /* SystemInitialize for Enabled SubSystem: '<S513>/CCVS1_31' */ |
| 30549 | /* SystemInitialize for Outport: '<S514>/TwoSpeedAxleSwitch' */ |
| 30550 | L4_MABX_B.SFunction1_o1_kp = L4_MABX_P.TwoSpeedAxleSwitch_Y0_a; |
| 30551 | |
| 30552 | /* SystemInitialize for Outport: '<S514>/ParkingBrakeSwitch' */ |
| 30553 | L4_MABX_B.SFunction1_o2_bl = L4_MABX_P.ParkingBrakeSwitch_Y0_e; |
| 30554 | |
| 30555 | /* SystemInitialize for Outport: '<S514>/CruiseCtrlPauseSwitch' */ |
| 30556 | L4_MABX_B.SFunction1_o3_g2 = L4_MABX_P.CruiseCtrlPauseSwitch_Y0_e; |
| 30557 | |
| 30558 | /* SystemInitialize for Outport: '<S514>/ParkBrakeReleaseInhibitRq' */ |
| 30559 | L4_MABX_B.SFunction1_o4_bx = L4_MABX_P.ParkBrakeReleaseInhibitRq_Y0_n; |
| 30560 | |
| 30561 | /* SystemInitialize for Outport: '<S514>/WheelBasedVehicleSpeed' */ |
| 30562 | L4_MABX_B.SFunction1_o5_p1 = L4_MABX_P.WheelBasedVehicleSpeed_Y0_i; |
| 30563 | |
| 30564 | /* SystemInitialize for Outport: '<S514>/CruiseCtrlActive' */ |
| 30565 | L4_MABX_B.SFunction1_o6_pt = L4_MABX_P.CruiseCtrlActive_Y0_j; |
| 30566 | |
| 30567 | /* SystemInitialize for Outport: '<S514>/CruiseCtrlEnableSwitch' */ |
| 30568 | L4_MABX_B.SFunction1_o7_g = L4_MABX_P.CruiseCtrlEnableSwitch_Y0_c; |
| 30569 | |
| 30570 | /* SystemInitialize for Outport: '<S514>/BrakeSwitch' */ |
| 30571 | L4_MABX_B.SFunction1_o8_fp = L4_MABX_P.BrakeSwitch_Y0_a; |
| 30572 | |
| 30573 | /* SystemInitialize for Outport: '<S514>/ClutchSwitch' */ |
| 30574 | L4_MABX_B.SFunction1_o9_gg = L4_MABX_P.ClutchSwitch_Y0_n; |
| 30575 | |
| 30576 | /* SystemInitialize for Outport: '<S514>/CruiseCtrlSetSwitch' */ |
| 30577 | L4_MABX_B.SFunction1_o10_cf = L4_MABX_P.CruiseCtrlSetSwitch_Y0_k; |
| 30578 | |
| 30579 | /* SystemInitialize for Outport: '<S514>/CruiseCtrlCoastSwitch' */ |
| 30580 | L4_MABX_B.SFunction1_o11_dy = L4_MABX_P.CruiseCtrlCoastSwitch_Y0_c; |
| 30581 | |
| 30582 | /* SystemInitialize for Outport: '<S514>/CruiseCtrlResumeSwitch' */ |
| 30583 | L4_MABX_B.SFunction1_o12_j = L4_MABX_P.CruiseCtrlResumeSwitch_Y0_n; |
| 30584 | |
| 30585 | /* SystemInitialize for Outport: '<S514>/CruiseCtrlAccelerateSwitch' */ |
| 30586 | L4_MABX_B.SFunction1_o13_og = L4_MABX_P.CruiseCtrlAccelerateSwitch_Y0_e; |
| 30587 | |
| 30588 | /* SystemInitialize for Outport: '<S514>/CruiseCtrlSetSpeed' */ |
| 30589 | L4_MABX_B.SFunction1_o14_p = L4_MABX_P.CruiseCtrlSetSpeed_Y0_n; |
| 30590 | |
| 30591 | /* SystemInitialize for Outport: '<S514>/PTOGovernorState' */ |
| 30592 | L4_MABX_B.SFunction1_o15_h = L4_MABX_P.PTOGovernorState_Y0_i; |
| 30593 | |
| 30594 | /* SystemInitialize for Outport: '<S514>/CruiseCtrlStates' */ |
| 30595 | L4_MABX_B.SFunction1_o16_m = L4_MABX_P.CruiseCtrlStates_Y0_k; |
| 30596 | |
| 30597 | /* SystemInitialize for Outport: '<S514>/EngIdleIncrementSwitch' */ |
| 30598 | L4_MABX_B.SFunction1_o17_k = L4_MABX_P.EngIdleIncrementSwitch_Y0_i; |
| 30599 | |
| 30600 | /* SystemInitialize for Outport: '<S514>/EngIdleDecrementSwitch' */ |
| 30601 | L4_MABX_B.SFunction1_o18_a = L4_MABX_P.EngIdleDecrementSwitch_Y0_i; |
| 30602 | |
| 30603 | /* SystemInitialize for Outport: '<S514>/EngTestModeSwitch' */ |
| 30604 | L4_MABX_B.SFunction1_o19_i = L4_MABX_P.EngTestModeSwitch_Y0_m; |
| 30605 | |
| 30606 | /* SystemInitialize for Outport: '<S514>/EngShutdownOverrideSwitch' */ |
| 30607 | L4_MABX_B.SFunction1_o20_i = L4_MABX_P.EngShutdownOverrideSwitch_Y0_b; |
| 30608 | |
| 30609 | /* SystemInitialize for Outport: '<S514>/RX status' */ |
| 30610 | L4_MABX_B.SFunction1_o21_e = L4_MABX_P.RXstatus_Y0_e; |
| 30611 | |
| 30612 | /* SystemInitialize for Outport: '<S514>/RX time' */ |
| 30613 | L4_MABX_B.SFunction1_o22_ih = L4_MABX_P.RXtime_Y0_l; |
| 30614 | |
| 30615 | /* SystemInitialize for Outport: '<S514>/RX delta time' */ |
| 30616 | L4_MABX_B.SFunction1_o23_i = L4_MABX_P.RXdeltatime_Y0_n; |
| 30617 | |
| 30618 | /* End of SystemInitialize for SubSystem: '<S513>/CCVS1_31' */ |
| 30619 | |
| 30620 | /* SystemInitialize for Enabled SubSystem: '<S524>/EBC2_0B1' */ |
| 30621 | /* SystemInitialize for Outport: '<S525>/FrontAxleSpeed' */ |
| 30622 | L4_MABX_B.SFunction1_o1_gd = L4_MABX_P.FrontAxleSpeed_Y0; |
| 30623 | |
| 30624 | /* SystemInitialize for Outport: '<S525>/RelativeSpeedFrontAxleLeftWheel' */ |
| 30625 | L4_MABX_B.SFunction1_o2_dl = L4_MABX_P.RelativeSpeedFrontAxleLeftWheel; |
| 30626 | |
| 30627 | /* SystemInitialize for Outport: '<S525>/RlativeSpeedFrontAxleRightWheel' */ |
| 30628 | L4_MABX_B.SFunction1_o3_hh = L4_MABX_P.RlativeSpeedFrontAxleRightWheel; |
| 30629 | |
| 30630 | /* SystemInitialize for Outport: '<S525>/RelativeSpeedRearAxle1LeftWheel' */ |
| 30631 | L4_MABX_B.SFunction1_o4_cs = L4_MABX_P.RelativeSpeedRearAxle1LeftWheel; |
| 30632 | |
| 30633 | /* SystemInitialize for Outport: '<S525>/RlativeSpeedRearAxle1RightWheel' */ |
| 30634 | L4_MABX_B.SFunction1_o5_o = L4_MABX_P.RlativeSpeedRearAxle1RightWheel; |
| 30635 | |
| 30636 | /* SystemInitialize for Outport: '<S525>/RelativeSpeedRearAxle2LeftWheel' */ |
| 30637 | L4_MABX_B.SFunction1_o6_la = L4_MABX_P.RelativeSpeedRearAxle2LeftWheel; |
| 30638 | |
| 30639 | /* SystemInitialize for Outport: '<S525>/RlativeSpeedRearAxle2RightWheel' */ |
| 30640 | L4_MABX_B.SFunction1_o7_lp = L4_MABX_P.RlativeSpeedRearAxle2RightWheel; |
| 30641 | |
| 30642 | /* SystemInitialize for Outport: '<S525>/RX status' */ |
| 30643 | L4_MABX_B.SFunction1_o8_bo = L4_MABX_P.RXstatus_Y0_k0; |
| 30644 | |
| 30645 | /* SystemInitialize for Outport: '<S525>/RX time' */ |
| 30646 | L4_MABX_B.SFunction1_o9_a = L4_MABX_P.RXtime_Y0_m; |
| 30647 | |
| 30648 | /* SystemInitialize for Outport: '<S525>/RX delta time' */ |
| 30649 | L4_MABX_B.SFunction1_o10_pk = L4_MABX_P.RXdeltatime_Y0_kr; |
| 30650 | |
| 30651 | /* End of SystemInitialize for SubSystem: '<S524>/EBC2_0B1' */ |
| 30652 | |
| 30653 | /* SystemInitialize for Enabled SubSystem: '<S582>/HRW_0B' */ |
| 30654 | /* SystemInitialize for Outport: '<S583>/FrontAxleLeftWheelSpeed' */ |
| 30655 | L4_MABX_B.SFunction1_o1_au = L4_MABX_P.FrontAxleLeftWheelSpeed_Y0; |
| 30656 | |
| 30657 | /* SystemInitialize for Outport: '<S583>/FrontAxleRightWheelSpeed' */ |
| 30658 | L4_MABX_B.SFunction1_o2_hu = L4_MABX_P.FrontAxleRightWheelSpeed_Y0; |
| 30659 | |
| 30660 | /* SystemInitialize for Outport: '<S583>/RearAxleLeftWheelSpeed' */ |
| 30661 | L4_MABX_B.SFunction1_o3_pw = L4_MABX_P.RearAxleLeftWheelSpeed_Y0; |
| 30662 | |
| 30663 | /* SystemInitialize for Outport: '<S583>/RearAxleRightWheelSpeed' */ |
| 30664 | L4_MABX_B.SFunction1_o4_auj = L4_MABX_P.RearAxleRightWheelSpeed_Y0; |
| 30665 | |
| 30666 | /* SystemInitialize for Outport: '<S583>/RX status' */ |
| 30667 | L4_MABX_B.SFunction1_o5_ij = L4_MABX_P.RXstatus_Y0_ef; |
| 30668 | |
| 30669 | /* SystemInitialize for Outport: '<S583>/RX time' */ |
| 30670 | L4_MABX_B.SFunction1_o6_kk = L4_MABX_P.RXtime_Y0_m0; |
| 30671 | |
| 30672 | /* SystemInitialize for Outport: '<S583>/RX delta time' */ |
| 30673 | L4_MABX_B.SFunction1_o7_cp = L4_MABX_P.RXdeltatime_Y0_ph; |
| 30674 | |
| 30675 | /* End of SystemInitialize for SubSystem: '<S582>/HRW_0B' */ |
| 30676 | |
| 30677 | /* SystemInitialize for Enabled SubSystem: '<S522>/EBC1_0B' */ |
| 30678 | /* SystemInitialize for Outport: '<S523>/ASREngCtrlActive' */ |
| 30679 | L4_MABX_B.SFunction1_o1_df = L4_MABX_P.ASREngCtrlActive_Y0_c; |
| 30680 | |
| 30681 | /* SystemInitialize for Outport: '<S523>/ASRBrakeCtrlActive' */ |
| 30682 | L4_MABX_B.SFunction1_o2_eb = L4_MABX_P.ASRBrakeCtrlActive_Y0_p; |
| 30683 | |
| 30684 | /* SystemInitialize for Outport: '<S523>/AntiLockBrakingActive' */ |
| 30685 | L4_MABX_B.SFunction1_o3_kb = L4_MABX_P.AntiLockBrakingActive_Y0_m; |
| 30686 | |
| 30687 | /* SystemInitialize for Outport: '<S523>/EBSBrakeSwitch' */ |
| 30688 | L4_MABX_B.SFunction1_o4_nj = L4_MABX_P.EBSBrakeSwitch_Y0_p; |
| 30689 | |
| 30690 | /* SystemInitialize for Outport: '<S523>/BrakePedalPos' */ |
| 30691 | L4_MABX_B.SFunction1_o5_k3 = L4_MABX_P.BrakePedalPos_Y0_j; |
| 30692 | |
| 30693 | /* SystemInitialize for Outport: '<S523>/ABSOffroadSwitch' */ |
| 30694 | L4_MABX_B.SFunction1_o6_hu = L4_MABX_P.ABSOffroadSwitch_Y0_d; |
| 30695 | |
| 30696 | /* SystemInitialize for Outport: '<S523>/ASROffroadSwitch' */ |
| 30697 | L4_MABX_B.SFunction1_o7_k = L4_MABX_P.ASROffroadSwitch_Y0_c; |
| 30698 | |
| 30699 | /* SystemInitialize for Outport: '<S523>/ASRHillHolderSwitch' */ |
| 30700 | L4_MABX_B.SFunction1_o8_lb = L4_MABX_P.ASRHillHolderSwitch_Y0_h; |
| 30701 | |
| 30702 | /* SystemInitialize for Outport: '<S523>/TractionCtrlOverrideSwitch' */ |
| 30703 | L4_MABX_B.SFunction1_o9_oz = L4_MABX_P.TractionCtrlOverrideSwitch_Y0_c; |
| 30704 | |
| 30705 | /* SystemInitialize for Outport: '<S523>/AccelInterlockSwitch' */ |
| 30706 | L4_MABX_B.SFunction1_o10_dd = L4_MABX_P.AccelInterlockSwitch_Y0_h; |
| 30707 | |
| 30708 | /* SystemInitialize for Outport: '<S523>/EngDerateSwitch' */ |
| 30709 | L4_MABX_B.SFunction1_o11_a2 = L4_MABX_P.EngDerateSwitch_Y0_m; |
| 30710 | |
| 30711 | /* SystemInitialize for Outport: '<S523>/EngAuxShutdownSwitch' */ |
| 30712 | L4_MABX_B.SFunction1_o12_c = L4_MABX_P.EngAuxShutdownSwitch_Y0_l; |
| 30713 | |
| 30714 | /* SystemInitialize for Outport: '<S523>/RemoteAccelEnableSwitch' */ |
| 30715 | L4_MABX_B.SFunction1_o13_o = L4_MABX_P.RemoteAccelEnableSwitch_Y0_g; |
| 30716 | |
| 30717 | /* SystemInitialize for Outport: '<S523>/EngRetarderSelection' */ |
| 30718 | L4_MABX_B.SFunction1_o14_l = L4_MABX_P.EngRetarderSelection_Y0_b; |
| 30719 | |
| 30720 | /* SystemInitialize for Outport: '<S523>/ABSFullyOperational' */ |
| 30721 | L4_MABX_B.SFunction1_o15_a = L4_MABX_P.ABSFullyOperational_Y0_o; |
| 30722 | |
| 30723 | /* SystemInitialize for Outport: '<S523>/EBSRedWarningSignal' */ |
| 30724 | L4_MABX_B.SFunction1_o16_ed = L4_MABX_P.EBSRedWarningSignal_Y0_i; |
| 30725 | |
| 30726 | /* SystemInitialize for Outport: '<S523>/ABS_EBSAmberWarningSignal' */ |
| 30727 | L4_MABX_B.SFunction1_o17_d = L4_MABX_P.ABS_EBSAmberWarningSignal_Y0_p; |
| 30728 | |
| 30729 | /* SystemInitialize for Outport: '<S523>/ATC_ASRInformationSignal' */ |
| 30730 | L4_MABX_B.SFunction1_o18_c = L4_MABX_P.ATC_ASRInformationSignal_Y0_h; |
| 30731 | |
| 30732 | /* SystemInitialize for Outport: '<S523>/SrcAddrssOfCtrllngDvcFrBrkCntrl' */ |
| 30733 | L4_MABX_B.SFunction1_o19_o = L4_MABX_P.SrcAddrssOfCtrllngDvcFrBrkCnt_i; |
| 30734 | |
| 30735 | /* SystemInitialize for Outport: '<S523>/HaltBrakeSwitch' */ |
| 30736 | L4_MABX_B.SFunction1_o20_e = L4_MABX_P.HaltBrakeSwitch_Y0_e; |
| 30737 | |
| 30738 | /* SystemInitialize for Outport: '<S523>/TrailerABSStatus' */ |
| 30739 | L4_MABX_B.SFunction1_o21_f = L4_MABX_P.TrailerABSStatus_Y0_l; |
| 30740 | |
| 30741 | /* SystemInitialize for Outport: '<S523>/TrctrMntdTrilerABSWarningSignal' */ |
| 30742 | L4_MABX_B.SFunction1_o22_o = L4_MABX_P.TrctrMntdTrilerABSWarningSign_f; |
| 30743 | |
| 30744 | /* SystemInitialize for Outport: '<S523>/RX status' */ |
| 30745 | L4_MABX_B.SFunction1_o23_b = L4_MABX_P.RXstatus_Y0_ei; |
| 30746 | |
| 30747 | /* SystemInitialize for Outport: '<S523>/RX time' */ |
| 30748 | L4_MABX_B.SFunction1_o24_l = L4_MABX_P.RXtime_Y0_de; |
| 30749 | |
| 30750 | /* SystemInitialize for Outport: '<S523>/RX delta time' */ |
| 30751 | L4_MABX_B.SFunction1_o25_p = L4_MABX_P.RXdeltatime_Y0_g; |
| 30752 | |
| 30753 | /* End of SystemInitialize for SubSystem: '<S522>/EBC1_0B' */ |
| 30754 | |
| 30755 | /* SystemInitialize for Enabled SubSystem: '<S577>/ETC2_031' */ |
| 30756 | /* SystemInitialize for Outport: '<S578>/SPN524_TransSelectedGear' */ |
| 30757 | L4_MABX_B.SFunction1_o1_nm = L4_MABX_P.SPN524_TransSelectedGear_Y0; |
| 30758 | |
| 30759 | /* SystemInitialize for Outport: '<S578>/SPN526_TransActualGearRatio' */ |
| 30760 | L4_MABX_B.SFunction1_o2_mp = L4_MABX_P.SPN526_TransActualGearRatio_Y0; |
| 30761 | |
| 30762 | /* SystemInitialize for Outport: '<S578>/SPN523_TransCurrentGear' */ |
| 30763 | L4_MABX_B.SFunction1_o3_cn = L4_MABX_P.SPN523_TransCurrentGear_Y0; |
| 30764 | |
| 30765 | /* SystemInitialize for Outport: '<S578>/RX status' */ |
| 30766 | L4_MABX_B.SFunction1_o4_ly = L4_MABX_P.RXstatus_Y0_me; |
| 30767 | |
| 30768 | /* SystemInitialize for Outport: '<S578>/RX time' */ |
| 30769 | L4_MABX_B.SFunction1_o5_e3 = L4_MABX_P.RXtime_Y0_h2; |
| 30770 | |
| 30771 | /* SystemInitialize for Outport: '<S578>/RX delta time' */ |
| 30772 | L4_MABX_B.SFunction1_o6_o = L4_MABX_P.RXdeltatime_Y0_a; |
| 30773 | |
| 30774 | /* End of SystemInitialize for SubSystem: '<S577>/ETC2_031' */ |
| 30775 | |
| 30776 | /* SystemInitialize for Enabled SubSystem: '<S571>/EEC1_001' */ |
| 30777 | /* SystemInitialize for Outport: '<S572>/EngTorqueMode' */ |
| 30778 | L4_MABX_B.SFunction1_o1_nr = L4_MABX_P.EngTorqueMode_Y0; |
| 30779 | |
| 30780 | /* SystemInitialize for Outport: '<S572>/ActlEngPrcntTrqueHighResolution' */ |
| 30781 | L4_MABX_B.SFunction1_o2_dgu = L4_MABX_P.ActlEngPrcntTrqueHighResolution; |
| 30782 | |
| 30783 | /* SystemInitialize for Outport: '<S572>/DriversDemandEngPercentTorque' */ |
| 30784 | L4_MABX_B.SFunction1_o3_ho = L4_MABX_P.DriversDemandEngPercentTorque_Y; |
| 30785 | |
| 30786 | /* SystemInitialize for Outport: '<S572>/ActualEngPercentTorque' */ |
| 30787 | L4_MABX_B.SFunction1_o4_ki = L4_MABX_P.ActualEngPercentTorque_Y0; |
| 30788 | |
| 30789 | /* SystemInitialize for Outport: '<S572>/EngSpeed' */ |
| 30790 | L4_MABX_B.SFunction1_o5_nl = L4_MABX_P.EngSpeed_Y0; |
| 30791 | |
| 30792 | /* SystemInitialize for Outport: '<S572>/SrcAddrssOfCtrllngDvcFrEngCntrl' */ |
| 30793 | L4_MABX_B.SFunction1_o6_hc = L4_MABX_P.SrcAddrssOfCtrllngDvcFrEngCntrl; |
| 30794 | |
| 30795 | /* SystemInitialize for Outport: '<S572>/EngStarterMode' */ |
| 30796 | L4_MABX_B.SFunction1_o7_ln = L4_MABX_P.EngStarterMode_Y0; |
| 30797 | |
| 30798 | /* SystemInitialize for Outport: '<S572>/EngDemandPercentTorque' */ |
| 30799 | L4_MABX_B.SFunction1_o8_f = L4_MABX_P.EngDemandPercentTorque_Y0; |
| 30800 | |
| 30801 | /* SystemInitialize for Outport: '<S572>/RX status' */ |
| 30802 | L4_MABX_B.SFunction1_o9_gn = L4_MABX_P.RXstatus_Y0_n; |
| 30803 | |
| 30804 | /* SystemInitialize for Outport: '<S572>/RX time' */ |
| 30805 | L4_MABX_B.SFunction1_o10_b = L4_MABX_P.RXtime_Y0_lm; |
| 30806 | |
| 30807 | /* SystemInitialize for Outport: '<S572>/RX delta time' */ |
| 30808 | L4_MABX_B.SFunction1_o11_b = L4_MABX_P.RXdeltatime_Y0_ky; |
| 30809 | |
| 30810 | /* End of SystemInitialize for SubSystem: '<S571>/EEC1_001' */ |
| 30811 | |
| 30812 | /* SystemInitialize for Enabled SubSystem: '<S575>/EEC3_001' */ |
| 30813 | /* SystemInitialize for Outport: '<S576>/SPN514_NominalFrictionPercentTorque' */ |
| 30814 | L4_MABX_B.SFunction1_o1_g = L4_MABX_P.SPN514_NominalFrictionPercentTo; |
| 30815 | |
| 30816 | /* SystemInitialize for Outport: '<S576>/SPN2978_EstEngParasiticLossesPercentTorque' */ |
| 30817 | L4_MABX_B.SFunction1_o2_ky = L4_MABX_P.SPN2978_EstEngParasiticLossesPe; |
| 30818 | |
| 30819 | /* SystemInitialize for Outport: '<S576>/RX status' */ |
| 30820 | L4_MABX_B.SFunction1_o3_fy = L4_MABX_P.RXstatus_Y0_n5; |
| 30821 | |
| 30822 | /* SystemInitialize for Outport: '<S576>/RX time' */ |
| 30823 | L4_MABX_B.SFunction1_o4_lo = L4_MABX_P.RXtime_Y0_l3; |
| 30824 | |
| 30825 | /* SystemInitialize for Outport: '<S576>/RX delta time' */ |
| 30826 | L4_MABX_B.SFunction1_o5_jl = L4_MABX_P.RXdeltatime_Y0_e3; |
| 30827 | |
| 30828 | /* End of SystemInitialize for SubSystem: '<S575>/EEC3_001' */ |
| 30829 | |
| 30830 | /* SystemInitialize for Enabled SubSystem: '<S518>/CVW_0B1' */ |
| 30831 | /* SystemInitialize for Outport: '<S519>/SPN1760_GrossCombinationVehicleWeight' */ |
| 30832 | L4_MABX_B.SFunction1_o1_kzx = L4_MABX_P.SPN1760_GrossCombinationVehicle; |
| 30833 | |
| 30834 | /* SystemInitialize for Outport: '<S519>/RX status' */ |
| 30835 | L4_MABX_B.SFunction1_o2_bq = L4_MABX_P.RXstatus_Y0_ge; |
| 30836 | |
| 30837 | /* SystemInitialize for Outport: '<S519>/RX time' */ |
| 30838 | L4_MABX_B.SFunction1_o3_dd = L4_MABX_P.RXtime_Y0_j; |
| 30839 | |
| 30840 | /* SystemInitialize for Outport: '<S519>/RX delta time' */ |
| 30841 | L4_MABX_B.SFunction1_o4_ha = L4_MABX_P.RXdeltatime_Y0_d1; |
| 30842 | |
| 30843 | /* End of SystemInitialize for SubSystem: '<S518>/CVW_0B1' */ |
| 30844 | |
| 30845 | /* SystemInitialize for Enabled SubSystem: '<S499>/ACC1_2A_' */ |
| 30846 | /* SystemInitialize for Outport: '<S500>/SpeedOfForwardVehicle' */ |
| 30847 | L4_MABX_B.SFunction1_o1_de = L4_MABX_P.SpeedOfForwardVehicle_Y0; |
| 30848 | |
| 30849 | /* SystemInitialize for Outport: '<S500>/DistanceToForwardVehicle' */ |
| 30850 | L4_MABX_B.SFunction1_o2_d5 = L4_MABX_P.DistanceToForwardVehicle_Y0; |
| 30851 | |
| 30852 | /* SystemInitialize for Outport: '<S500>/AdaptiveCruiseCtrlSetSpeed' */ |
| 30853 | L4_MABX_B.SFunction1_o3_dg = L4_MABX_P.AdaptiveCruiseCtrlSetSpeed_Y0; |
| 30854 | |
| 30855 | /* SystemInitialize for Outport: '<S500>/AdaptiveCruiseCtrlMode' */ |
| 30856 | L4_MABX_B.SFunction1_o4_bc = L4_MABX_P.AdaptiveCruiseCtrlMode_Y0; |
| 30857 | |
| 30858 | /* SystemInitialize for Outport: '<S500>/AdptveCruiseCtrlSetDistanceMode' */ |
| 30859 | L4_MABX_B.SFunction1_o5_k4 = L4_MABX_P.AdptveCruiseCtrlSetDistanceMode; |
| 30860 | |
| 30861 | /* SystemInitialize for Outport: '<S500>/RoadCurvature' */ |
| 30862 | L4_MABX_B.SFunction1_o6_j5 = L4_MABX_P.RoadCurvature_Y0; |
| 30863 | |
| 30864 | /* SystemInitialize for Outport: '<S500>/ACCTargetDetected' */ |
| 30865 | L4_MABX_B.SFunction1_o7_hh = L4_MABX_P.ACCTargetDetected_Y0; |
| 30866 | |
| 30867 | /* SystemInitialize for Outport: '<S500>/ACCSystemShutoffWarning' */ |
| 30868 | L4_MABX_B.SFunction1_o8_oi = L4_MABX_P.ACCSystemShutoffWarning_Y0; |
| 30869 | |
| 30870 | /* SystemInitialize for Outport: '<S500>/ACCDistanceAlertSignal' */ |
| 30871 | L4_MABX_B.SFunction1_o9_ih = L4_MABX_P.ACCDistanceAlertSignal_Y0; |
| 30872 | |
| 30873 | /* SystemInitialize for Outport: '<S500>/ForwardCollisionWarning' */ |
| 30874 | L4_MABX_B.SFunction1_o10_py = L4_MABX_P.ForwardCollisionWarning_Y0; |
| 30875 | |
| 30876 | /* SystemInitialize for Outport: '<S500>/RX status' */ |
| 30877 | L4_MABX_B.SFunction1_o11_mg = L4_MABX_P.RXstatus_Y0_k; |
| 30878 | |
| 30879 | /* SystemInitialize for Outport: '<S500>/RX time' */ |
| 30880 | L4_MABX_B.SFunction1_o12_n = L4_MABX_P.RXtime_Y0_d; |
| 30881 | |
| 30882 | /* SystemInitialize for Outport: '<S500>/RX delta time' */ |
| 30883 | L4_MABX_B.SFunction1_o13_or = L4_MABX_P.RXdeltatime_Y0_k; |
| 30884 | |
| 30885 | /* End of SystemInitialize for SubSystem: '<S499>/ACC1_2A_' */ |
| 30886 | |
| 30887 | /* SystemInitialize for Enabled SubSystem: '<S481>/CAN_TYPE1_RX_M1_C1' */ |
| 30888 | /* SystemInitialize for Outport: '<S483>/byte1' */ |
| 30889 | L4_MABX_B.SFunction1_o1_bv = L4_MABX_P.byte1_Y0; |
| 30890 | |
| 30891 | /* SystemInitialize for Outport: '<S483>/byte2' */ |
| 30892 | L4_MABX_B.SFunction1_o2_kv = L4_MABX_P.byte2_Y0; |
| 30893 | |
| 30894 | /* SystemInitialize for Outport: '<S483>/byte3' */ |
| 30895 | L4_MABX_B.SFunction1_o3_j2 = L4_MABX_P.byte3_Y0; |
| 30896 | |
| 30897 | /* SystemInitialize for Outport: '<S483>/byte4' */ |
| 30898 | L4_MABX_B.SFunction1_o4_fp = L4_MABX_P.byte4_Y0; |
| 30899 | |
| 30900 | /* SystemInitialize for Outport: '<S483>/byte5' */ |
| 30901 | L4_MABX_B.SFunction1_o5_mi = L4_MABX_P.byte5_Y0; |
| 30902 | |
| 30903 | /* SystemInitialize for Outport: '<S483>/byte6' */ |
| 30904 | L4_MABX_B.SFunction1_o6_kp = L4_MABX_P.byte6_Y0; |
| 30905 | |
| 30906 | /* SystemInitialize for Outport: '<S483>/byte7' */ |
| 30907 | L4_MABX_B.SFunction1_o7_gb = L4_MABX_P.byte7_Y0; |
| 30908 | |
| 30909 | /* SystemInitialize for Outport: '<S483>/byte8' */ |
| 30910 | L4_MABX_B.SFunction1_o8_ez = L4_MABX_P.byte8_Y0; |
| 30911 | |
| 30912 | /* SystemInitialize for Outport: '<S483>/RX status' */ |
| 30913 | L4_MABX_B.SFunction1_o9_ad = L4_MABX_P.RXstatus_Y0; |
| 30914 | |
| 30915 | /* SystemInitialize for Outport: '<S483>/RX time' */ |
| 30916 | L4_MABX_B.SFunction1_o10_n = L4_MABX_P.RXtime_Y0; |
| 30917 | |
| 30918 | /* SystemInitialize for Outport: '<S483>/RX delta time' */ |
| 30919 | L4_MABX_B.SFunction1_o11_p = L4_MABX_P.RXdeltatime_Y0; |
| 30920 | |
| 30921 | /* End of SystemInitialize for SubSystem: '<S481>/CAN_TYPE1_RX_M1_C1' */ |
| 30922 | |
| 30923 | /* SystemInitialize for Enabled SubSystem: '<S475>/Decode_TPCM_BAM' */ |
| 30924 | /* SystemInitialize for Outport: '<S693>/Out' */ |
| 30925 | L4_MABX_B.SPN2556_ControlByte_n = (uint8_T)L4_MABX_P.Out_Y0_f; |
| 30926 | L4_MABX_B.DataType_h1 = (uint16_T)L4_MABX_P.Out_Y0_f; |
| 30927 | L4_MABX_B.SPN2568_TotalNumberOfPackets = (uint8_T)L4_MABX_P.Out_Y0_f; |
| 30928 | L4_MABX_B.DataType_jy = (uint32_T)L4_MABX_P.Out_Y0_f; |
| 30929 | |
| 30930 | /* End of SystemInitialize for SubSystem: '<S475>/Decode_TPCM_BAM' */ |
| 30931 | |
| 30932 | /* SystemInitialize for Enabled SubSystem: '<S490>/CAN_TYPE1_RX_M1_C1' */ |
| 30933 | /* SystemInitialize for Outport: '<S492>/byte1' */ |
| 30934 | L4_MABX_B.SFunction1_o1_jh = L4_MABX_P.byte1_Y0_d; |
| 30935 | |
| 30936 | /* SystemInitialize for Outport: '<S492>/byte2' */ |
| 30937 | L4_MABX_B.SFunction1_o2_e2 = L4_MABX_P.byte2_Y0_d; |
| 30938 | |
| 30939 | /* SystemInitialize for Outport: '<S492>/byte3' */ |
| 30940 | L4_MABX_B.SFunction1_o3_id = L4_MABX_P.byte3_Y0_e; |
| 30941 | |
| 30942 | /* SystemInitialize for Outport: '<S492>/byte4' */ |
| 30943 | L4_MABX_B.SFunction1_o4_jm = L4_MABX_P.byte4_Y0_k; |
| 30944 | |
| 30945 | /* SystemInitialize for Outport: '<S492>/byte5' */ |
| 30946 | L4_MABX_B.SFunction1_o5_h = L4_MABX_P.byte5_Y0_l; |
| 30947 | |
| 30948 | /* SystemInitialize for Outport: '<S492>/byte6' */ |
| 30949 | L4_MABX_B.SFunction1_o6_c = L4_MABX_P.byte6_Y0_n; |
| 30950 | |
| 30951 | /* SystemInitialize for Outport: '<S492>/byte7' */ |
| 30952 | L4_MABX_B.SFunction1_o7_dv = L4_MABX_P.byte7_Y0_n; |
| 30953 | |
| 30954 | /* SystemInitialize for Outport: '<S492>/byte8' */ |
| 30955 | L4_MABX_B.SFunction1_o8_of = L4_MABX_P.byte8_Y0_n; |
| 30956 | |
| 30957 | /* SystemInitialize for Outport: '<S492>/RX status' */ |
| 30958 | L4_MABX_B.SFunction1_o9_dt = L4_MABX_P.RXstatus_Y0_g; |
| 30959 | |
| 30960 | /* SystemInitialize for Outport: '<S492>/RX time' */ |
| 30961 | L4_MABX_B.SFunction1_o10_hj = L4_MABX_P.RXtime_Y0_n; |
| 30962 | |
| 30963 | /* SystemInitialize for Outport: '<S492>/RX delta time' */ |
| 30964 | L4_MABX_B.SFunction1_o11_h = L4_MABX_P.RXdeltatime_Y0_e; |
| 30965 | |
| 30966 | /* End of SystemInitialize for SubSystem: '<S490>/CAN_TYPE1_RX_M1_C1' */ |
| 30967 | |
| 30968 | /* SystemInitialize for S-Function (rti_commonblock): '<S854>/S-Function1' incorporates: |
| 30969 | * SubSystem: '<S423>/IncrementTimer' |
| 30970 | */ |
| 30971 | L4_MABX_IncrementTimer_Init(); |
| 30972 | |
| 30973 | /* End of SystemInitialize for S-Function (rti_commonblock): '<S854>/S-Function1' */ |
| 30974 | |
| 30975 | /* SystemInitialize for Enabled SubSystem: '<S442>/CAN_RX_EC1_00' */ |
| 30976 | /* SystemInitialize for Enabled SubSystem: '<S526>/Decode' */ |
| 30977 | /* InitializeConditions for UnitDelay: '<S529>/Unit_Delay' */ |
| 30978 | L4_MABX_DW.Unit_Delay_DSTATE_i = L4_MABX_P.Unit_Delay_InitialCondition_o; |
| 30979 | for (i = 0; i < 39; i++) { |
| 30980 | /* InitializeConditions for UnitDelay: '<S526>/Unit Delay' */ |
| 30981 | L4_MABX_DW.UnitDelay_DSTATE_b3[i] = |
| 30982 | L4_MABX_P.UnitDelay_InitialCondition_j2[i]; |
| 30983 | |
| 30984 | /* SystemInitialize for Outport: '<S529>/RawData' */ |
| 30985 | L4_MABX_B.Inport_b[i] = L4_MABX_P.RawData_Y0; |
| 30986 | } |
| 30987 | |
| 30988 | /* SystemInitialize for Outport: '<S529>/RX_time' */ |
| 30989 | L4_MABX_B.timeStamp_j = L4_MABX_P.RX_time_Y0; |
| 30990 | |
| 30991 | /* SystemInitialize for Outport: '<S529>/RX_delta_time' */ |
| 30992 | L4_MABX_B.Subtract_gi = L4_MABX_P.RX_delta_time_Y0; |
| 30993 | |
| 30994 | /* End of SystemInitialize for SubSystem: '<S526>/Decode' */ |
| 30995 | |
| 30996 | /* SystemInitialize for Outport: '<S526>/RX_status' */ |
| 30997 | L4_MABX_B.RX_status_pz = L4_MABX_P.RX_status_Y0; |
| 30998 | |
| 30999 | /* End of SystemInitialize for SubSystem: '<S442>/CAN_RX_EC1_00' */ |
| 31000 | |
| 31001 | /* SystemInitialize for Enabled SubSystem: '<S648>/VDC1_0B_' */ |
| 31002 | /* SystemInitialize for Outport: '<S649>/VDCInformationSignal' */ |
| 31003 | L4_MABX_B.SFunction1_o1_n5 = L4_MABX_P.VDCInformationSignal_Y0; |
| 31004 | |
| 31005 | /* SystemInitialize for Outport: '<S649>/VDCFullyOperational' */ |
| 31006 | L4_MABX_B.SFunction1_o2_c5 = L4_MABX_P.VDCFullyOperational_Y0; |
| 31007 | |
| 31008 | /* SystemInitialize for Outport: '<S649>/VDCBrakeLightRq' */ |
| 31009 | L4_MABX_B.SFunction1_o3_e2 = L4_MABX_P.VDCBrakeLightRq_Y0; |
| 31010 | |
| 31011 | /* SystemInitialize for Outport: '<S649>/ROPEngCtrlActive' */ |
| 31012 | L4_MABX_B.SFunction1_o4_lj = L4_MABX_P.ROPEngCtrlActive_Y0; |
| 31013 | |
| 31014 | /* SystemInitialize for Outport: '<S649>/ROPBrakeCtrlActive' */ |
| 31015 | L4_MABX_B.SFunction1_o5_i = L4_MABX_P.ROPBrakeCtrlActive_Y0; |
| 31016 | |
| 31017 | /* SystemInitialize for Outport: '<S649>/YCEngCtrlActive' */ |
| 31018 | L4_MABX_B.SFunction1_o6_d = L4_MABX_P.YCEngCtrlActive_Y0; |
| 31019 | |
| 31020 | /* SystemInitialize for Outport: '<S649>/YCBrakeCtrlActive' */ |
| 31021 | L4_MABX_B.SFunction1_o7_h = L4_MABX_P.YCBrakeCtrlActive_Y0; |
| 31022 | |
| 31023 | /* SystemInitialize for Outport: '<S649>/RX status' */ |
| 31024 | L4_MABX_B.SFunction1_o8_m = L4_MABX_P.RXstatus_Y0_gk; |
| 31025 | |
| 31026 | /* SystemInitialize for Outport: '<S649>/RX time' */ |
| 31027 | L4_MABX_B.SFunction1_o9_m = L4_MABX_P.RXtime_Y0_hl; |
| 31028 | |
| 31029 | /* SystemInitialize for Outport: '<S649>/RX delta time' */ |
| 31030 | L4_MABX_B.SFunction1_o10 = L4_MABX_P.RXdeltatime_Y0_ot; |
| 31031 | |
| 31032 | /* End of SystemInitialize for SubSystem: '<S648>/VDC1_0B_' */ |
| 31033 | |
| 31034 | /* SystemInitialize for Enabled SubSystem: '<S650>/VDC2_0B1' */ |
| 31035 | /* SystemInitialize for Outport: '<S651>/SteerWheelAngle' */ |
| 31036 | SteerWheelAngle = L4_MABX_P.SteerWheelAngle_Y0; |
| 31037 | |
| 31038 | /* SystemInitialize for Outport: '<S651>/SteerWheelTurnCounter' */ |
| 31039 | L4_MABX_B.SFunction1_o2_gn = L4_MABX_P.SteerWheelTurnCounter_Y0; |
| 31040 | |
| 31041 | /* SystemInitialize for Outport: '<S651>/SteerWheelAngleSensorType' */ |
| 31042 | L4_MABX_B.SFunction1_o3_jk = L4_MABX_P.SteerWheelAngleSensorType_Y0; |
| 31043 | |
| 31044 | /* SystemInitialize for Outport: '<S651>/YawRate' */ |
| 31045 | YawRate = L4_MABX_P.YawRate_Y0; |
| 31046 | |
| 31047 | /* SystemInitialize for Outport: '<S651>/LateralAcceleration' */ |
| 31048 | L4_MABX_B.SFunction1_o5_f = L4_MABX_P.LateralAcceleration_Y0; |
| 31049 | |
| 31050 | /* SystemInitialize for Outport: '<S651>/LongitudinalAcceleration' */ |
| 31051 | SPN1810_LongitudinalAcceleration = L4_MABX_P.LongitudinalAcceleration_Y0; |
| 31052 | |
| 31053 | /* SystemInitialize for Outport: '<S651>/RX status' */ |
| 31054 | L4_MABX_B.SFunction1_o7_f = L4_MABX_P.RXstatus_Y0_k0m; |
| 31055 | |
| 31056 | /* SystemInitialize for Outport: '<S651>/RX time' */ |
| 31057 | L4_MABX_B.SFunction1_o8_p = L4_MABX_P.RXtime_Y0_jd; |
| 31058 | |
| 31059 | /* SystemInitialize for Outport: '<S651>/RX delta time' */ |
| 31060 | L4_MABX_B.SFunction1_o9 = L4_MABX_P.RXdeltatime_Y0_nx; |
| 31061 | |
| 31062 | /* End of SystemInitialize for SubSystem: '<S650>/VDC2_0B1' */ |
| 31063 | |
| 31064 | /* SystemInitialize for Enabled SubSystem: '<S465>/CAN_RX_VI_00' */ |
| 31065 | /* SystemInitialize for Enabled SubSystem: '<S654>/Decode' */ |
| 31066 | /* InitializeConditions for UnitDelay: '<S657>/Unit_Delay' */ |
| 31067 | L4_MABX_DW.Unit_Delay_DSTATE_d = L4_MABX_P.Unit_Delay_InitialCondition_a; |
| 31068 | for (i = 0; i < 17; i++) { |
| 31069 | /* InitializeConditions for UnitDelay: '<S654>/Unit Delay' */ |
| 31070 | L4_MABX_DW.UnitDelay_DSTATE_o[i] = |
| 31071 | L4_MABX_P.UnitDelay_InitialCondition_nl[i]; |
| 31072 | |
| 31073 | /* SystemInitialize for Outport: '<S657>/RawData' */ |
| 31074 | L4_MABX_B.Inport[i] = L4_MABX_P.RawData_Y0_e; |
| 31075 | } |
| 31076 | |
| 31077 | /* SystemInitialize for Outport: '<S657>/RX_time' */ |
| 31078 | L4_MABX_B.timeStamp = L4_MABX_P.RX_time_Y0_n; |
| 31079 | |
| 31080 | /* SystemInitialize for Outport: '<S657>/RX_delta_time' */ |
| 31081 | L4_MABX_B.Subtract_j3 = L4_MABX_P.RX_delta_time_Y0_n; |
| 31082 | |
| 31083 | /* End of SystemInitialize for SubSystem: '<S654>/Decode' */ |
| 31084 | |
| 31085 | /* SystemInitialize for Outport: '<S654>/RX_status' */ |
| 31086 | L4_MABX_B.RX_status_bk = L4_MABX_P.RX_status_Y0_e; |
| 31087 | |
| 31088 | /* End of SystemInitialize for SubSystem: '<S465>/CAN_RX_VI_00' */ |
| 31089 | |
| 31090 | /* SystemInitialize for Enabled SubSystem: '<S636>/SSI2_031' */ |
| 31091 | /* SystemInitialize for Outport: '<S637>/PitchAngleExRange' */ |
| 31092 | L4_MABX_B.SFunction1_o1_fk = L4_MABX_P.PitchAngleExRange_Y0; |
| 31093 | |
| 31094 | /* SystemInitialize for Outport: '<S637>/RollAngleExRange' */ |
| 31095 | L4_MABX_B.SFunction1_o2_pq = L4_MABX_P.RollAngleExRange_Y0; |
| 31096 | |
| 31097 | /* SystemInitialize for Outport: '<S637>/PitchAngleExRangeCompensation' */ |
| 31098 | L4_MABX_B.SFunction1_o3_eq = L4_MABX_P.PitchAngleExRangeCompensation_Y; |
| 31099 | |
| 31100 | /* SystemInitialize for Outport: '<S637>/PitchAngleExRangeFigureOfMerit' */ |
| 31101 | L4_MABX_B.SFunction1_o4_be = L4_MABX_P.PitchAngleExRangeFigureOfMerit_; |
| 31102 | |
| 31103 | /* SystemInitialize for Outport: '<S637>/RollAngleExRangeCompensation' */ |
| 31104 | L4_MABX_B.SFunction1_o5_fy = L4_MABX_P.RollAngleExRangeCompensation_Y0; |
| 31105 | |
| 31106 | /* SystemInitialize for Outport: '<S637>/RollAngleExRangeFigureOfMerit' */ |
| 31107 | L4_MABX_B.SFunction1_o6_l = L4_MABX_P.RollAngleExRangeFigureOfMerit_Y; |
| 31108 | |
| 31109 | /* SystemInitialize for Outport: '<S637>/RllAndPtchExRngMsurementLatency' */ |
| 31110 | L4_MABX_B.SFunction1_o7_p = L4_MABX_P.RllAndPtchExRngMsurementLatency; |
| 31111 | |
| 31112 | /* SystemInitialize for Outport: '<S637>/RX status' */ |
| 31113 | L4_MABX_B.SFunction1_o8_h = L4_MABX_P.RXstatus_Y0_gi; |
| 31114 | |
| 31115 | /* SystemInitialize for Outport: '<S637>/RX time' */ |
| 31116 | L4_MABX_B.SFunction1_o9_i = L4_MABX_P.RXtime_Y0_ba; |
| 31117 | |
| 31118 | /* SystemInitialize for Outport: '<S637>/RX delta time' */ |
| 31119 | L4_MABX_B.SFunction1_o10_ha = L4_MABX_P.RXdeltatime_Y0_jh; |
| 31120 | |
| 31121 | /* End of SystemInitialize for SubSystem: '<S636>/SSI2_031' */ |
| 31122 | |
| 31123 | /* SystemInitialize for Enabled SubSystem: '<S627>/PX2_LanePosEst' */ |
| 31124 | /* SystemInitialize for Outport: '<S630>/PX2_LanePosEstAngle' */ |
| 31125 | L4_MABX_B.SFunction1_o1_oq = L4_MABX_P.PX2_LanePosEstAngle_Y0; |
| 31126 | |
| 31127 | /* SystemInitialize for Outport: '<S630>/PX2_LanePosEstNumPoints' */ |
| 31128 | L4_MABX_B.SFunction1_o2_mr = L4_MABX_P.PX2_LanePosEstNumPoints_Y0; |
| 31129 | |
| 31130 | /* SystemInitialize for Outport: '<S630>/PX2_LanePosEstPosition' */ |
| 31131 | L4_MABX_B.SFunction1_o3_ev = L4_MABX_P.PX2_LanePosEstPosition_Y0; |
| 31132 | |
| 31133 | /* SystemInitialize for Outport: '<S630>/PX2_LanePosEstNumLanes' */ |
| 31134 | L4_MABX_B.SFunction1_o4_aw = L4_MABX_P.PX2_LanePosEstNumLanes_Y0; |
| 31135 | |
| 31136 | /* SystemInitialize for Outport: '<S630>/RX status' */ |
| 31137 | L4_MABX_B.SFunction1_o5_b = L4_MABX_P.RXstatus_Y0_pt; |
| 31138 | |
| 31139 | /* SystemInitialize for Outport: '<S630>/RX time' */ |
| 31140 | L4_MABX_B.SFunction1_o6_kc = L4_MABX_P.RXtime_Y0_pg; |
| 31141 | |
| 31142 | /* SystemInitialize for Outport: '<S630>/RX delta time' */ |
| 31143 | L4_MABX_B.SFunction1_o7_d = L4_MABX_P.RXdeltatime_Y0_huf; |
| 31144 | |
| 31145 | /* End of SystemInitialize for SubSystem: '<S627>/PX2_LanePosEst' */ |
| 31146 | |
| 31147 | /* SystemInitialize for Enabled SubSystem: '<S634>/Bendix_Prop2C2_Status_30' */ |
| 31148 | /* SystemInitialize for Outport: '<S635>/PressureP4' */ |
| 31149 | L4_MABX_B.SFunction1_o1_ko = L4_MABX_P.PressureP4_Y0; |
| 31150 | |
| 31151 | /* SystemInitialize for Outport: '<S635>/PressureP1' */ |
| 31152 | L4_MABX_B.SFunction1_o2_jn = L4_MABX_P.PressureP1_Y0; |
| 31153 | |
| 31154 | /* SystemInitialize for Outport: '<S635>/PressureP21' */ |
| 31155 | L4_MABX_B.SFunction1_o3_hm = L4_MABX_P.PressureP21_Y0; |
| 31156 | |
| 31157 | /* SystemInitialize for Outport: '<S635>/PressureP22' */ |
| 31158 | L4_MABX_B.SFunction1_o4_hk = L4_MABX_P.PressureP22_Y0; |
| 31159 | |
| 31160 | /* SystemInitialize for Outport: '<S635>/PressureP42' */ |
| 31161 | L4_MABX_B.SFunction1_o5_fg = L4_MABX_P.PressureP42_Y0; |
| 31162 | |
| 31163 | /* SystemInitialize for Outport: '<S635>/XPR1ControlStatus' */ |
| 31164 | L4_MABX_B.SFunction1_o6_a = L4_MABX_P.XPR1ControlStatus_Y0; |
| 31165 | |
| 31166 | /* SystemInitialize for Outport: '<S635>/XPR2ControlStatus' */ |
| 31167 | L4_MABX_B.SFunction1_o7_a = L4_MABX_P.XPR2ControlStatus_Y0; |
| 31168 | |
| 31169 | /* SystemInitialize for Outport: '<S635>/XPR3ControlStatus' */ |
| 31170 | L4_MABX_B.SFunction1_o8_b = L4_MABX_P.XPR3ControlStatus_Y0; |
| 31171 | |
| 31172 | /* SystemInitialize for Outport: '<S635>/XPRErrorState' */ |
| 31173 | L4_MABX_B.SFunction1_o9_l = L4_MABX_P.XPRErrorState_Y0; |
| 31174 | |
| 31175 | /* SystemInitialize for Outport: '<S635>/XPRControlMode' */ |
| 31176 | L4_MABX_B.SFunction1_o10_d = L4_MABX_P.XPRControlMode_Y0; |
| 31177 | |
| 31178 | /* SystemInitialize for Outport: '<S635>/RX status' */ |
| 31179 | L4_MABX_B.SFunction1_o11_d = L4_MABX_P.RXstatus_Y0_f1; |
| 31180 | |
| 31181 | /* SystemInitialize for Outport: '<S635>/RX time' */ |
| 31182 | L4_MABX_B.SFunction1_o12_k = L4_MABX_P.RXtime_Y0_hc; |
| 31183 | |
| 31184 | /* SystemInitialize for Outport: '<S635>/RX delta time' */ |
| 31185 | L4_MABX_B.SFunction1_o13_g = L4_MABX_P.RXdeltatime_Y0_cy; |
| 31186 | |
| 31187 | /* End of SystemInitialize for SubSystem: '<S634>/Bendix_Prop2C2_Status_30' */ |
| 31188 | |
| 31189 | /* SystemInitialize for Enabled SubSystem: '<S584>/PropB_REAX_2_13' */ |
| 31190 | /* SystemInitialize for Outport: '<S586>/PropB_REAX_2_ActualHandwheelPos' */ |
| 31191 | L4_MABX_B.SFunction1_o1_cs = L4_MABX_P.PropB_REAX_2_ActualHandwheelPos; |
| 31192 | |
| 31193 | /* SystemInitialize for Outport: '<S586>/PropB_REAX_2_EchoedStrWhlPos' */ |
| 31194 | L4_MABX_B.SFunction1_o2_jnu = L4_MABX_P.PropB_REAX_2_EchoedStrWhlPos_Y0; |
| 31195 | |
| 31196 | /* SystemInitialize for Outport: '<S586>/RX status' */ |
| 31197 | L4_MABX_B.SFunction1_o3_pv = L4_MABX_P.RXstatus_Y0_g1; |
| 31198 | |
| 31199 | /* SystemInitialize for Outport: '<S586>/RX time' */ |
| 31200 | L4_MABX_B.SFunction1_o4_c = L4_MABX_P.RXtime_Y0_iz; |
| 31201 | |
| 31202 | /* SystemInitialize for Outport: '<S586>/RX delta time' */ |
| 31203 | L4_MABX_B.SFunction1_o5_ni = L4_MABX_P.RXdeltatime_Y0_c; |
| 31204 | |
| 31205 | /* End of SystemInitialize for SubSystem: '<S584>/PropB_REAX_2_13' */ |
| 31206 | |
| 31207 | /* SystemInitialize for Enabled SubSystem: '<S585>/PropB_REAX_2_13' */ |
| 31208 | /* SystemInitialize for Outport: '<S587>/PropB_REAX_2_ActualHandwheelPos' */ |
| 31209 | L4_MABX_B.SFunction1_o1_ph = L4_MABX_P.PropB_REAX_2_ActualHandwheelP_c; |
| 31210 | |
| 31211 | /* SystemInitialize for Outport: '<S587>/PropB_REAX_2_EchoedStrWhlPos' */ |
| 31212 | L4_MABX_B.SFunction1_o2_g5 = L4_MABX_P.PropB_REAX_2_EchoedStrWhlPos__c; |
| 31213 | |
| 31214 | /* SystemInitialize for Outport: '<S587>/RX status' */ |
| 31215 | L4_MABX_B.SFunction1_o3_l1 = L4_MABX_P.RXstatus_Y0_il; |
| 31216 | |
| 31217 | /* SystemInitialize for Outport: '<S587>/RX time' */ |
| 31218 | L4_MABX_B.SFunction1_o4_k1 = L4_MABX_P.RXtime_Y0_hu; |
| 31219 | |
| 31220 | /* SystemInitialize for Outport: '<S587>/RX delta time' */ |
| 31221 | L4_MABX_B.SFunction1_o5_j = L4_MABX_P.RXdeltatime_Y0_lw; |
| 31222 | |
| 31223 | /* End of SystemInitialize for SubSystem: '<S585>/PropB_REAX_2_13' */ |
| 31224 | |
| 31225 | /* SystemInitialize for Atomic SubSystem: '<S65>/Task_10ms' */ |
| 31226 | /* InitializeConditions for UnitDelay: '<S97>/Unit Delay1' */ |
| 31227 | L4_MABX_DW.UnitDelay1_DSTATE_m = L4_MABX_P.UnitDelay1_InitialCondition; |
| 31228 | |
| 31229 | /* InitializeConditions for UnitDelay: '<S76>/Unit_Delay' */ |
| 31230 | L4_MABX_DW.Unit_Delay_DSTATE_fv = L4_MABX_P.Unit_Delay_InitialCondition_jn; |
| 31231 | |
| 31232 | /* InitializeConditions for UnitDelay: '<S98>/Delay Input1' */ |
| 31233 | L4_MABX_DW.DelayInput1_DSTATE_d = L4_MABX_P.DetectFallNonpositive_vinit; |
| 31234 | |
| 31235 | /* InitializeConditions for UnitDelay: '<S97>/Unit Delay' */ |
| 31236 | L4_MABX_DW.UnitDelay_DSTATE_b1 = L4_MABX_P.UnitDelay_InitialCondition_br; |
| 31237 | |
| 31238 | /* InitializeConditions for RateTransition: '<S81>/TmpRTBAtSignal Conversion1Inport1' */ |
| 31239 | L4_MABX_DW.TmpRTBAtSignalConversion1Inport = |
| 31240 | L4_MABX_P.TmpRTBAtSignalConversion1Inport; |
| 31241 | |
| 31242 | /* InitializeConditions for UnitDelay: '<S395>/Unit_Delay' */ |
| 31243 | L4_MABX_DW.Unit_Delay_DSTATE_cx = L4_MABX_P.Unit_Delay_InitialCondition_b1; |
| 31244 | |
| 31245 | /* InitializeConditions for UnitDelay: '<S396>/Unit_Delay' */ |
| 31246 | L4_MABX_DW.Unit_Delay_DSTATE_d0 = L4_MABX_P.Unit_Delay_InitialCondition_g; |
| 31247 | |
| 31248 | /* InitializeConditions for UnitDelay: '<S353>/Unit_Delay' */ |
| 31249 | L4_MABX_DW.Unit_Delay_DSTATE_e = L4_MABX_P.Unit_Delay_InitialCondition_i; |
| 31250 | |
| 31251 | /* InitializeConditions for UnitDelay: '<S400>/FixPt Unit Delay2' */ |
| 31252 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_aq = |
| 31253 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_f5; |
| 31254 | |
| 31255 | /* InitializeConditions for UnitDelay: '<S400>/FixPt Unit Delay1' */ |
| 31256 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_h = |
| 31257 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_l; |
| 31258 | |
| 31259 | /* InitializeConditions for UnitDelay: '<S397>/Unit_Delay' */ |
| 31260 | L4_MABX_DW.Unit_Delay_DSTATE_m = L4_MABX_P.Unit_Delay_InitialCondition_hae; |
| 31261 | |
| 31262 | /* InitializeConditions for UnitDelay: '<S384>/Unit_Delay' */ |
| 31263 | L4_MABX_DW.Unit_Delay_DSTATE_iy = L4_MABX_P.Unit_Delay_InitialCondition_aw; |
| 31264 | |
| 31265 | /* InitializeConditions for UnitDelay: '<S385>/Unit_Delay' */ |
| 31266 | L4_MABX_DW.Unit_Delay_DSTATE_mv = L4_MABX_P.Unit_Delay_InitialCondition_gt; |
| 31267 | |
| 31268 | /* InitializeConditions for UnitDelay: '<S351>/Unit_Delay' */ |
| 31269 | L4_MABX_DW.Unit_Delay_DSTATE_g = L4_MABX_P.Unit_Delay_InitialCondition_fb; |
| 31270 | |
| 31271 | /* InitializeConditions for UnitDelay: '<S389>/FixPt Unit Delay2' */ |
| 31272 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_ip = |
| 31273 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_po; |
| 31274 | |
| 31275 | /* InitializeConditions for UnitDelay: '<S389>/FixPt Unit Delay1' */ |
| 31276 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_hq = |
| 31277 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_d; |
| 31278 | |
| 31279 | /* InitializeConditions for UnitDelay: '<S386>/Unit_Delay' */ |
| 31280 | L4_MABX_DW.Unit_Delay_DSTATE_b = L4_MABX_P.Unit_Delay_InitialCondition_c; |
| 31281 | |
| 31282 | /* InitializeConditions for RateTransition: '<S81>/TmpRTBAtSignal Conversion3Inport1' */ |
| 31283 | L4_MABX_DW.TmpRTBAtSignalConversion3Inport = |
| 31284 | L4_MABX_P.TmpRTBAtSignalConversion3Inport; |
| 31285 | |
| 31286 | /* InitializeConditions for RateTransition: '<S81>/TmpRTBAtSignal Conversion2Inport1' */ |
| 31287 | L4_MABX_DW.TmpRTBAtSignalConversion2Inport = |
| 31288 | L4_MABX_P.TmpRTBAtSignalConversion2Inport; |
| 31289 | |
| 31290 | /* InitializeConditions for UnitDelay: '<S366>/Unit_Delay' */ |
| 31291 | L4_MABX_DW.Unit_Delay_DSTATE_bw = L4_MABX_P.Unit_Delay_InitialCondition_e; |
| 31292 | |
| 31293 | /* InitializeConditions for UnitDelay: '<S368>/Unit_Delay' */ |
| 31294 | L4_MABX_DW.Unit_Delay_DSTATE_ko = L4_MABX_P.Unit_Delay_InitialCondition_ml; |
| 31295 | |
| 31296 | /* InitializeConditions for UnitDelay: '<S377>/FixPt Unit Delay2' */ |
| 31297 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_f = |
| 31298 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_i; |
| 31299 | |
| 31300 | /* InitializeConditions for UnitDelay: '<S377>/FixPt Unit Delay1' */ |
| 31301 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_l = |
| 31302 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_h; |
| 31303 | |
| 31304 | /* InitializeConditions for UnitDelay: '<S375>/Unit_Delay' */ |
| 31305 | L4_MABX_DW.Unit_Delay_DSTATE_p = L4_MABX_P.Unit_Delay_InitialCondition_j; |
| 31306 | |
| 31307 | /* InitializeConditions for UnitDelay: '<S348>/Delay Input1' */ |
| 31308 | L4_MABX_DW.DelayInput1_DSTATE[0] = L4_MABX_P.DetectChange1_vinit; |
| 31309 | |
| 31310 | /* InitializeConditions for UnitDelay: '<S355>/Delay Input1' */ |
| 31311 | L4_MABX_DW.DelayInput1_DSTATE_f[0] = L4_MABX_P.DetectChange1_vinit_n; |
| 31312 | |
| 31313 | /* InitializeConditions for UnitDelay: '<S348>/Delay Input1' */ |
| 31314 | L4_MABX_DW.DelayInput1_DSTATE[1] = L4_MABX_P.DetectChange1_vinit; |
| 31315 | |
| 31316 | /* InitializeConditions for UnitDelay: '<S355>/Delay Input1' */ |
| 31317 | L4_MABX_DW.DelayInput1_DSTATE_f[1] = L4_MABX_P.DetectChange1_vinit_n; |
| 31318 | |
| 31319 | /* InitializeConditions for UnitDelay: '<S357>/Unit_Delay' */ |
| 31320 | L4_MABX_DW.Unit_Delay_DSTATE_l = L4_MABX_P.Unit_Delay_InitialCondition_ag; |
| 31321 | |
| 31322 | /* InitializeConditions for UnitDelay: '<S361>/FixPt Unit Delay2' */ |
| 31323 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_c = |
| 31324 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_ck; |
| 31325 | |
| 31326 | /* InitializeConditions for UnitDelay: '<S361>/FixPt Unit Delay1' */ |
| 31327 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_ej = |
| 31328 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_m; |
| 31329 | |
| 31330 | /* InitializeConditions for UnitDelay: '<S356>/Unit_Delay' */ |
| 31331 | L4_MABX_DW.Unit_Delay_1_DSTATE_j = L4_MABX_P.Unit_Delay_1_InitialCondition; |
| 31332 | L4_MABX_DW.Unit_Delay_2_DSTATE_e = L4_MABX_P.Unit_Delay_2_InitialCondition; |
| 31333 | L4_MABX_DW.Unit_Delay_3_DSTATE_j = L4_MABX_P.Unit_Delay_3_InitialCondition; |
| 31334 | |
| 31335 | /* InitializeConditions for UnitDelay: '<S354>/Unit_Delay' */ |
| 31336 | L4_MABX_DW.Unit_Delay_DSTATE_f = L4_MABX_P.Unit_Delay_InitialCondition_e2; |
| 31337 | |
| 31338 | /* InitializeConditions for UnitDelay: '<S107>/Unit_Delay' */ |
| 31339 | L4_MABX_DW.Unit_Delay_DSTATE_eu4 = L4_MABX_P.Unit_Delay_InitialCondition_ip; |
| 31340 | |
| 31341 | /* InitializeConditions for UnitDelay: '<S203>/Unit_Delay1' */ |
| 31342 | L4_MABX_DW.Unit_Delay1_DSTATE_di = L4_MABX_P.Unit_Delay1_InitialCondition_f; |
| 31343 | |
| 31344 | /* InitializeConditions for UnitDelay: '<S203>/Unit_Delay2' */ |
| 31345 | L4_MABX_DW.Unit_Delay2_DSTATE_e = L4_MABX_P.Unit_Delay2_InitialCondition_a; |
| 31346 | |
| 31347 | /* InitializeConditions for UnitDelay: '<S202>/UD' */ |
| 31348 | L4_MABX_DW.UD_DSTATE = L4_MABX_P.DiscreteDerivative1_ICPrevScale; |
| 31349 | |
| 31350 | /* InitializeConditions for UnitDelay: '<S333>/Unit_Delay1' */ |
| 31351 | L4_MABX_DW.Unit_Delay1_DSTATE_db = L4_MABX_P.Unit_Delay1_InitialCondition_m; |
| 31352 | |
| 31353 | /* InitializeConditions for UnitDelay: '<S333>/Unit_Delay2' */ |
| 31354 | L4_MABX_DW.Unit_Delay2_DSTATE_d = L4_MABX_P.Unit_Delay2_InitialCondition_g; |
| 31355 | |
| 31356 | /* InitializeConditions for UnitDelay: '<S332>/Delay Input1' */ |
| 31357 | L4_MABX_DW.DelayInput1_DSTATE_f0 = L4_MABX_P.DetectChange_vinit; |
| 31358 | |
| 31359 | /* InitializeConditions for UnitDelay: '<S334>/Unit_Delay1' */ |
| 31360 | L4_MABX_DW.Unit_Delay1_DSTATE_a = L4_MABX_P.Unit_Delay1_InitialCondition_ps; |
| 31361 | |
| 31362 | /* InitializeConditions for UnitDelay: '<S334>/Unit_Delay2' */ |
| 31363 | L4_MABX_DW.Unit_Delay2_DSTATE_i = L4_MABX_P.Unit_Delay2_InitialCondition_ji; |
| 31364 | |
| 31365 | /* InitializeConditions for UnitDelay: '<S335>/Unit_Delay1' */ |
| 31366 | L4_MABX_DW.Unit_Delay1_DSTATE_p3 = L4_MABX_P.Unit_Delay1_InitialCondition_j; |
| 31367 | |
| 31368 | /* InitializeConditions for UnitDelay: '<S335>/Unit_Delay2' */ |
| 31369 | L4_MABX_DW.Unit_Delay2_DSTATE_p = L4_MABX_P.Unit_Delay2_InitialCondition_ap; |
| 31370 | |
| 31371 | /* InitializeConditions for UnitDelay: '<S285>/Unit Delay' */ |
| 31372 | L4_MABX_DW.UnitDelay_DSTATE_d = L4_MABX_P.UnitDelay_InitialCondition_c; |
| 31373 | |
| 31374 | /* InitializeConditions for UnitDelay: '<S295>/Unit Delay' */ |
| 31375 | L4_MABX_DW.UnitDelay_DSTATE_m = L4_MABX_P.UnitDelay_InitialCondition; |
| 31376 | |
| 31377 | /* InitializeConditions for UnitDelay: '<S296>/Unit Delay' */ |
| 31378 | L4_MABX_DW.UnitDelay_DSTATE_m0 = L4_MABX_P.UnitDelay_InitialCondition_g; |
| 31379 | |
| 31380 | /* InitializeConditions for UnitDelay: '<S296>/Unit Delay1' */ |
| 31381 | L4_MABX_DW.UnitDelay1_DSTATE_k = L4_MABX_P.UnitDelay1_InitialCondition_j; |
| 31382 | |
| 31383 | /* InitializeConditions for RateTransition: '<S80>/TmpRTBAtrad2deg1Inport1' */ |
| 31384 | L4_MABX_DW.TmpRTBAtrad2deg1Inport1_Buffer0 = |
| 31385 | L4_MABX_P.TmpRTBAtrad2deg1Inport1_Initial; |
| 31386 | |
| 31387 | /* InitializeConditions for RateTransition: '<S80>/TmpRTBAtsignCurveOffsetInport1' */ |
| 31388 | L4_MABX_DW.TmpRTBAtsignCurveOffsetInport1_ = |
| 31389 | L4_MABX_P.TmpRTBAtsignCurveOffsetInport1_; |
| 31390 | |
| 31391 | /* InitializeConditions for UnitDelay: '<S290>/Unit Delay' */ |
| 31392 | L4_MABX_DW.UnitDelay_DSTATE_m1 = L4_MABX_P.UnitDelay_InitialCondition_eo; |
| 31393 | |
| 31394 | /* InitializeConditions for RateTransition: '<S284>/TmpRTBAtAdd2Inport2' */ |
| 31395 | L4_MABX_DW.TmpRTBAtAdd2Inport2_Buffer0 = |
| 31396 | L4_MABX_P.TmpRTBAtAdd2Inport2_InitialCond; |
| 31397 | |
| 31398 | /* InitializeConditions for UnitDelay: '<S314>/Delay Input2' */ |
| 31399 | L4_MABX_DW.DelayInput2_DSTATE = L4_MABX_P.DelayInput2_InitialCondition; |
| 31400 | |
| 31401 | /* InitializeConditions for DiscreteIntegrator: '<S313>/Integrator' */ |
| 31402 | L4_MABX_DW.Integrator_DSTATE = L4_MABX_P.Integrator_IC; |
| 31403 | L4_MABX_DW.Integrator_PrevResetState = 2; |
| 31404 | |
| 31405 | /* InitializeConditions for DiscreteIntegrator: '<S313>/Filter' */ |
| 31406 | L4_MABX_DW.Filter_DSTATE = L4_MABX_P.Filter_IC; |
| 31407 | L4_MABX_DW.Filter_PrevResetState = 2; |
| 31408 | |
| 31409 | /* InitializeConditions for UnitDelay: '<S317>/Delay Input' */ |
| 31410 | L4_MABX_DW.DelayInput_DSTATE = L4_MABX_P.TransferFcnLeadorLag_ICPrevInpu; |
| 31411 | |
| 31412 | /* InitializeConditions for UnitDelay: '<S317>/Delay Output' */ |
| 31413 | L4_MABX_DW.DelayOutput_DSTATE = L4_MABX_P.TransferFcnLeadorLag_ICPrevOutp; |
| 31414 | |
| 31415 | /* InitializeConditions for UnitDelay: '<S315>/Delay Input2' */ |
| 31416 | L4_MABX_DW.DelayInput2_DSTATE_a = L4_MABX_P.DelayInput2_InitialCondition_m; |
| 31417 | |
| 31418 | /* InitializeConditions for DiscreteIntegrator: '<S307>/Discrete-Time Integrator' */ |
| 31419 | L4_MABX_DW.DiscreteTimeIntegrator_IC_LOADI = 1U; |
| 31420 | L4_MABX_DW.DiscreteTimeIntegrator_PrevRese = 2; |
| 31421 | |
| 31422 | /* InitializeConditions for UnitDelay: '<S327>/Delay Input2' */ |
| 31423 | L4_MABX_DW.DelayInput2_DSTATE_l = L4_MABX_P.DelayInput2_InitialCondition_g; |
| 31424 | |
| 31425 | /* InitializeConditions for UnitDelay: '<S304>/Delay Input2' */ |
| 31426 | L4_MABX_DW.DelayInput2_DSTATE_o = L4_MABX_P.DelayInput2_InitialCondition_b; |
| 31427 | |
| 31428 | /* InitializeConditions for DiscreteIntegrator: '<S80>/Discrete-Time Integrator' */ |
| 31429 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e = |
| 31430 | L4_MABX_P.DiscreteTimeIntegrator_IC; |
| 31431 | L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e = 0; |
| 31432 | |
| 31433 | /* InitializeConditions for RateLimiter: '<S301>/Limit Rate Limiter' */ |
| 31434 | L4_MABX_DW.PrevY = L4_MABX_P.LimitRateLimiter_IC; |
| 31435 | |
| 31436 | /* InitializeConditions for RateLimiter: '<S316>/Limit Rate Limiter' */ |
| 31437 | L4_MABX_DW.PrevY_o = L4_MABX_P.LimitRateLimiter_IC_i; |
| 31438 | |
| 31439 | /* InitializeConditions for UnitDelay: '<S80>/Unit Delay' */ |
| 31440 | L4_MABX_DW.UnitDelay_DSTATE_e = L4_MABX_P.UnitDelay_InitialCondition_g1; |
| 31441 | |
| 31442 | /* InitializeConditions for UnitDelay: '<S379>/FixPt Unit Delay2' */ |
| 31443 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_aw = |
| 31444 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_g; |
| 31445 | |
| 31446 | /* InitializeConditions for UnitDelay: '<S379>/FixPt Unit Delay1' */ |
| 31447 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_p = |
| 31448 | L4_MABX_P.FixPtUnitDelay1_InitialCondi_dl; |
| 31449 | |
| 31450 | /* InitializeConditions for UnitDelay: '<S380>/FixPt Unit Delay2' */ |
| 31451 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_gx = |
| 31452 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_pz; |
| 31453 | |
| 31454 | /* InitializeConditions for UnitDelay: '<S380>/FixPt Unit Delay1' */ |
| 31455 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g0 = |
| 31456 | L4_MABX_P.FixPtUnitDelay1_InitialCondi_ol; |
| 31457 | |
| 31458 | /* InitializeConditions for UnitDelay: '<S374>/Unit_Delay' */ |
| 31459 | L4_MABX_DW.Unit_Delay_DSTATE_j = L4_MABX_P.Unit_Delay_InitialCondition_b; |
| 31460 | |
| 31461 | /* SystemInitialize for Enabled SubSystem: '<S79>/Throttle_controller_gov' */ |
| 31462 | /* InitializeConditions for UnitDelay: '<S220>/Unit_Delay1' */ |
| 31463 | L4_MABX_DW.Unit_Delay1_DSTATE_p1 = L4_MABX_P.Unit_Delay1_InitialCondition_o; |
| 31464 | |
| 31465 | /* InitializeConditions for UnitDelay: '<S220>/Unit_Delay' */ |
| 31466 | L4_MABX_DW.Unit_Delay_DSTATE_lq = L4_MABX_P.Unit_Delay_InitialCondition_b2; |
| 31467 | |
| 31468 | /* InitializeConditions for UnitDelay: '<S247>/Unit_Delay' */ |
| 31469 | L4_MABX_DW.Unit_Delay_DSTATE_be = L4_MABX_P.Unit_Delay_InitialCondition_lj; |
| 31470 | |
| 31471 | /* InitializeConditions for UnitDelay: '<S267>/Unit_Delay1' */ |
| 31472 | L4_MABX_DW.Unit_Delay1_DSTATE_h = L4_MABX_P.Unit_Delay1_InitialCondition_a; |
| 31473 | |
| 31474 | /* InitializeConditions for UnitDelay: '<S268>/Unit_Delay' */ |
| 31475 | L4_MABX_DW.Unit_Delay_DSTATE_fi = L4_MABX_P.Unit_Delay_InitialCondition_bm; |
| 31476 | |
| 31477 | /* InitializeConditions for UnitDelay: '<S272>/FixPt Unit Delay2' */ |
| 31478 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_gq = |
| 31479 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_a; |
| 31480 | |
| 31481 | /* InitializeConditions for UnitDelay: '<S272>/FixPt Unit Delay1' */ |
| 31482 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_a = |
| 31483 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_o; |
| 31484 | |
| 31485 | /* InitializeConditions for UnitDelay: '<S267>/Unit_Delay2' */ |
| 31486 | L4_MABX_DW.Unit_Delay2_DSTATE_m = L4_MABX_P.Unit_Delay2_InitialCondition_j; |
| 31487 | |
| 31488 | /* InitializeConditions for UnitDelay: '<S222>/Unit_Delay' */ |
| 31489 | L4_MABX_DW.Unit_Delay_DSTATE_fz = L4_MABX_P.Unit_Delay_InitialCondition_kg; |
| 31490 | |
| 31491 | /* SystemInitialize for Enabled SubSystem: '<S244>/Calculate_D_term' */ |
| 31492 | L4_MA_Calculate_D_term_Init(&L4_MABX_B.Calculate_D_term_h, |
| 31493 | &L4_MABX_DW.Calculate_D_term_h, &L4_MABX_P.Calculate_D_term_h); |
| 31494 | |
| 31495 | /* End of SystemInitialize for SubSystem: '<S244>/Calculate_D_term' */ |
| 31496 | |
| 31497 | /* SystemInitialize for Enabled SubSystem: '<S244>/Calculate_I_term' */ |
| 31498 | L4_MA_Calculate_I_term_Init(&L4_MABX_B.Calculate_I_term_n, |
| 31499 | &L4_MABX_DW.Calculate_I_term_n, &L4_MABX_P.Calculate_I_term_n); |
| 31500 | |
| 31501 | /* End of SystemInitialize for SubSystem: '<S244>/Calculate_I_term' */ |
| 31502 | |
| 31503 | /* SystemInitialize for Outport: '<S212>/PID_output' */ |
| 31504 | L4_MABX_B.If_Then_Else_pi.Switch = L4_MABX_P.PID_output_Y0_c; |
| 31505 | |
| 31506 | /* SystemInitialize for Outport: '<S212>/PID_output_unlim' */ |
| 31507 | L4_MABX_B.Add_ds = L4_MABX_P.PID_output_unlim_Y0; |
| 31508 | |
| 31509 | /* SystemInitialize for Outport: '<S212>/PID_control_error' */ |
| 31510 | L4_MABX_B.If_Then_Else_k2.Switch = L4_MABX_P.PID_control_error_Y0; |
| 31511 | |
| 31512 | /* SystemInitialize for Outport: '<S212>/PID_p_term' */ |
| 31513 | L4_MABX_B.Product_i = L4_MABX_P.PID_p_term_Y0; |
| 31514 | |
| 31515 | /* SystemInitialize for Outport: '<S212>/PID_i_term' */ |
| 31516 | L4_MABX_B.PID_i_term_c = L4_MABX_P.PID_i_term_Y0; |
| 31517 | |
| 31518 | /* SystemInitialize for Outport: '<S212>/PID_d_term' */ |
| 31519 | L4_MABX_B.PID_d_term_c = L4_MABX_P.PID_d_term_Y0; |
| 31520 | |
| 31521 | /* SystemInitialize for Outport: '<S212>/PID_hold_i_term_f' */ |
| 31522 | L4_MABX_B.PID_hold_i_term_f_b = L4_MABX_P.PID_hold_i_term_f_Y0; |
| 31523 | |
| 31524 | /* End of SystemInitialize for SubSystem: '<S79>/Throttle_controller_gov' */ |
| 31525 | |
| 31526 | /* SystemInitialize for Enabled SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */ |
| 31527 | /* InitializeConditions for UnitDelay: '<S184>/Unit_Delay' */ |
| 31528 | L4_MABX_DW.Unit_Delay_DSTATE_o = L4_MABX_P.Unit_Delay_InitialCondition_l; |
| 31529 | |
| 31530 | /* InitializeConditions for UnitDelay: '<S194>/Unit_Delay' */ |
| 31531 | L4_MABX_DW.Unit_Delay_DSTATE_ae = L4_MABX_P.Unit_Delay_InitialCondition_cl; |
| 31532 | |
| 31533 | /* InitializeConditions for UnitDelay: '<S198>/FixPt Unit Delay2' */ |
| 31534 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_l = |
| 31535 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_f; |
| 31536 | |
| 31537 | /* InitializeConditions for UnitDelay: '<S198>/FixPt Unit Delay1' */ |
| 31538 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_ds = |
| 31539 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_j; |
| 31540 | |
| 31541 | /* InitializeConditions for UnitDelay: '<S195>/Unit_Delay' */ |
| 31542 | L4_MABX_DW.Unit_Delay_DSTATE_om = L4_MABX_P.Unit_Delay_InitialCondition_ha; |
| 31543 | |
| 31544 | /* SystemInitialize for Outport: '<S184>/Shift_interlock_brake_press_target_kpa' */ |
| 31545 | L4_MABX_B.If_Then_Else_il.Switch = L4_MABX_P.Shift_interlock_brake_press_tar; |
| 31546 | |
| 31547 | /* SystemInitialize for Outport: '<S184>/F_Shift_interlock_conditions_met' */ |
| 31548 | L4_MABX_B.F_Shift_interlock_conditions_me = |
| 31549 | L4_MABX_P.F_Shift_interlock_conditions_me; |
| 31550 | |
| 31551 | /* End of SystemInitialize for SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */ |
| 31552 | |
| 31553 | /* SystemInitialize for Enabled SubSystem: '<S105>/Determine_brake_hold_pressure_target' */ |
| 31554 | /* InitializeConditions for UnitDelay: '<S183>/Unit_Delay' */ |
| 31555 | L4_MABX_DW.Unit_Delay_DSTATE_c = L4_MABX_P.Unit_Delay_InitialCondition_d; |
| 31556 | |
| 31557 | /* InitializeConditions for UnitDelay: '<S187>/Unit_Delay' */ |
| 31558 | L4_MABX_DW.Unit_Delay_DSTATE_or = L4_MABX_P.Unit_Delay_InitialCondition_fy; |
| 31559 | |
| 31560 | /* InitializeConditions for UnitDelay: '<S191>/FixPt Unit Delay2' */ |
| 31561 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_je = |
| 31562 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_e; |
| 31563 | |
| 31564 | /* InitializeConditions for UnitDelay: '<S191>/FixPt Unit Delay1' */ |
| 31565 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_b = |
| 31566 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_p; |
| 31567 | |
| 31568 | /* InitializeConditions for UnitDelay: '<S188>/Unit_Delay' */ |
| 31569 | L4_MABX_DW.Unit_Delay_DSTATE_oj = L4_MABX_P.Unit_Delay_InitialCondition_k; |
| 31570 | |
| 31571 | /* SystemInitialize for Outport: '<S183>/Brake_hold_brake_press_target_kpa' */ |
| 31572 | L4_MABX_B.If_Then_Else_gj.Switch = L4_MABX_P.Brake_hold_brake_press_target_k; |
| 31573 | |
| 31574 | /* SystemInitialize for Outport: '<S183>/F_Brake_hold_conditions_met' */ |
| 31575 | L4_MABX_B.F_Brake_hold_conditions_met = |
| 31576 | L4_MABX_P.F_Brake_hold_conditions_met_Y0; |
| 31577 | |
| 31578 | /* End of SystemInitialize for SubSystem: '<S105>/Determine_brake_hold_pressure_target' */ |
| 31579 | |
| 31580 | /* SystemInitialize for Enabled SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */ |
| 31581 | /* InitializeConditions for UnitDelay: '<S111>/Unit_Delay' */ |
| 31582 | L4_MABX_DW.Unit_Delay_DSTATE_dc = L4_MABX_P.Unit_Delay_InitialCondition; |
| 31583 | |
| 31584 | /* InitializeConditions for UnitDelay: '<S115>/Unit_Delay' */ |
| 31585 | L4_MABX_DW.Unit_Delay_DSTATE_omj = L4_MABX_P.Unit_Delay_InitialCondition_lt; |
| 31586 | |
| 31587 | /* InitializeConditions for UnitDelay: '<S135>/Unit_Delay1' */ |
| 31588 | L4_MABX_DW.Unit_Delay1_DSTATE_b = L4_MABX_P.Unit_Delay1_InitialCondition; |
| 31589 | |
| 31590 | /* InitializeConditions for UnitDelay: '<S136>/Unit_Delay' */ |
| 31591 | L4_MABX_DW.Unit_Delay_DSTATE_h4 = L4_MABX_P.Unit_Delay_InitialCondition_og; |
| 31592 | |
| 31593 | /* InitializeConditions for UnitDelay: '<S140>/FixPt Unit Delay2' */ |
| 31594 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_gm = |
| 31595 | L4_MABX_P.FixPtUnitDelay2_InitialConditio; |
| 31596 | |
| 31597 | /* InitializeConditions for UnitDelay: '<S140>/FixPt Unit Delay1' */ |
| 31598 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g1 = |
| 31599 | L4_MABX_P.FixPtUnitDelay1_InitialConditio; |
| 31600 | |
| 31601 | /* InitializeConditions for UnitDelay: '<S135>/Unit_Delay2' */ |
| 31602 | L4_MABX_DW.Unit_Delay2_DSTATE_dy = L4_MABX_P.Unit_Delay2_InitialCondition; |
| 31603 | |
| 31604 | /* InitializeConditions for UnitDelay: '<S110>/Unit_Delay' */ |
| 31605 | L4_MABX_DW.Unit_Delay_DSTATE_i2 = L4_MABX_P.Unit_Delay_InitialCondition_p; |
| 31606 | |
| 31607 | /* SystemInitialize for Enabled SubSystem: '<S112>/Calculate_D_term' */ |
| 31608 | L4_MA_Calculate_D_term_Init(&L4_MABX_B.Calculate_D_term, |
| 31609 | &L4_MABX_DW.Calculate_D_term, &L4_MABX_P.Calculate_D_term); |
| 31610 | |
| 31611 | /* End of SystemInitialize for SubSystem: '<S112>/Calculate_D_term' */ |
| 31612 | |
| 31613 | /* SystemInitialize for Enabled SubSystem: '<S112>/Calculate_I_term' */ |
| 31614 | L4_MA_Calculate_I_term_Init(&L4_MABX_B.Calculate_I_term, |
| 31615 | &L4_MABX_DW.Calculate_I_term, &L4_MABX_P.Calculate_I_term); |
| 31616 | |
| 31617 | /* End of SystemInitialize for SubSystem: '<S112>/Calculate_I_term' */ |
| 31618 | |
| 31619 | /* SystemInitialize for Outport: '<S102>/PID_output' */ |
| 31620 | L4_MABX_B.If_Then_Else_nj.Switch = L4_MABX_P.PID_output_Y0; |
| 31621 | |
| 31622 | /* End of SystemInitialize for SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */ |
| 31623 | |
| 31624 | /* SystemInitialize for Chart: '<S350>/VehicleSpeedSetpointDynamicCalculation' */ |
| 31625 | L4_MABX_B.TimeVectorRaw[0] = 0.0; |
| 31626 | L4_MABX_B.TimeVectorRaw[1] = 0.001; |
| 31627 | L4_MABX_B.TimeVectorRaw[2] = 0.002; |
| 31628 | L4_MABX_B.TimeVectorRaw[3] = 0.003; |
| 31629 | L4_MABX_B.TimeVectorRaw[4] = 0.004; |
| 31630 | L4_MABX_B.TimeVectorRaw[5] = 0.005; |
| 31631 | L4_MABX_B.PositionVectorRaw[0] = 0.0; |
| 31632 | L4_MABX_B.PositionVectorRaw[1] = 0.001; |
| 31633 | L4_MABX_B.PositionVectorRaw[2] = 0.002; |
| 31634 | L4_MABX_B.PositionVectorRaw[3] = 0.003; |
| 31635 | L4_MABX_B.PositionVectorRaw[4] = 0.004; |
| 31636 | L4_MABX_B.PositionVectorRaw[5] = 0.005; |
| 31637 | for (i = 0; i < 6; i++) { |
| 31638 | L4_MABX_B.VelocityVectorRaw[i] = 0.0; |
| 31639 | L4_MABX_B.AccelerationVectorRaw[i] = 0.0; |
| 31640 | L4_MABX_B.JerkVectorRaw[i] = 0.0; |
| 31641 | } |
| 31642 | |
| 31643 | /* End of SystemInitialize for Chart: '<S350>/VehicleSpeedSetpointDynamicCalculation' */ |
| 31644 | |
| 31645 | /* SystemInitialize for Chart: '<S350>/TwentyPointVectorCalculation' */ |
| 31646 | L4_MABX_B.TimeVector[0] = 0.0; |
| 31647 | L4_MABX_B.TimeVector[1] = 0.001; |
| 31648 | L4_MABX_B.TimeVector[2] = 0.002; |
| 31649 | L4_MABX_B.TimeVector[3] = 0.003; |
| 31650 | L4_MABX_B.TimeVector[4] = 0.004; |
| 31651 | L4_MABX_B.TimeVector[5] = 0.005; |
| 31652 | L4_MABX_B.TimeVector[6] = 0.006; |
| 31653 | L4_MABX_B.TimeVector[7] = 0.007; |
| 31654 | L4_MABX_B.TimeVector[8] = 0.008; |
| 31655 | L4_MABX_B.TimeVector[9] = 0.0090000000000000011; |
| 31656 | L4_MABX_B.TimeVector[10] = 0.01; |
| 31657 | L4_MABX_B.TimeVector[11] = 0.011; |
| 31658 | L4_MABX_B.TimeVector[12] = 0.012; |
| 31659 | L4_MABX_B.TimeVector[13] = 0.013000000000000001; |
| 31660 | L4_MABX_B.TimeVector[14] = 0.014; |
| 31661 | L4_MABX_B.TimeVector[15] = 0.015; |
| 31662 | L4_MABX_B.TimeVector[16] = 0.016; |
| 31663 | L4_MABX_B.TimeVector[17] = 0.017; |
| 31664 | L4_MABX_B.TimeVector[18] = 0.018000000000000002; |
| 31665 | L4_MABX_B.TimeVector[19] = 0.019; |
| 31666 | L4_MABX_B.TimeVector[20] = 0.02; |
| 31667 | L4_MABX_B.TimeVector[21] = 0.021; |
| 31668 | L4_MABX_B.TimeVector[22] = 0.022; |
| 31669 | L4_MABX_B.TimeVector[23] = 0.023; |
| 31670 | L4_MABX_B.TimeVector[24] = 0.024; |
| 31671 | L4_MABX_B.TimeVector[25] = 0.025; |
| 31672 | L4_MABX_B.TimeVector[26] = 0.026000000000000002; |
| 31673 | L4_MABX_B.TimeVector[27] = 0.027; |
| 31674 | L4_MABX_B.TimeVector[28] = 0.028; |
| 31675 | L4_MABX_B.TimeVector[29] = 0.029; |
| 31676 | L4_MABX_B.TimeVector[30] = 0.03; |
| 31677 | L4_MABX_B.TimeVector[31] = 0.031; |
| 31678 | L4_MABX_B.TimeVector[32] = 0.032; |
| 31679 | L4_MABX_B.PositionVector[0] = 0.0; |
| 31680 | L4_MABX_B.PositionVector[1] = 0.001; |
| 31681 | L4_MABX_B.PositionVector[2] = 0.002; |
| 31682 | L4_MABX_B.PositionVector[3] = 0.003; |
| 31683 | L4_MABX_B.PositionVector[4] = 0.004; |
| 31684 | L4_MABX_B.PositionVector[5] = 0.005; |
| 31685 | L4_MABX_B.PositionVector[6] = 0.006; |
| 31686 | L4_MABX_B.PositionVector[7] = 0.007; |
| 31687 | L4_MABX_B.PositionVector[8] = 0.008; |
| 31688 | L4_MABX_B.PositionVector[9] = 0.0090000000000000011; |
| 31689 | L4_MABX_B.PositionVector[10] = 0.01; |
| 31690 | L4_MABX_B.PositionVector[11] = 0.011; |
| 31691 | L4_MABX_B.PositionVector[12] = 0.012; |
| 31692 | L4_MABX_B.PositionVector[13] = 0.013000000000000001; |
| 31693 | L4_MABX_B.PositionVector[14] = 0.014; |
| 31694 | L4_MABX_B.PositionVector[15] = 0.015; |
| 31695 | L4_MABX_B.PositionVector[16] = 0.016; |
| 31696 | L4_MABX_B.PositionVector[17] = 0.017; |
| 31697 | L4_MABX_B.PositionVector[18] = 0.018000000000000002; |
| 31698 | L4_MABX_B.PositionVector[19] = 0.019; |
| 31699 | L4_MABX_B.PositionVector[20] = 0.02; |
| 31700 | L4_MABX_B.PositionVector[21] = 0.021; |
| 31701 | L4_MABX_B.PositionVector[22] = 0.022; |
| 31702 | L4_MABX_B.PositionVector[23] = 0.023; |
| 31703 | L4_MABX_B.PositionVector[24] = 0.024; |
| 31704 | L4_MABX_B.PositionVector[25] = 0.025; |
| 31705 | L4_MABX_B.PositionVector[26] = 0.026000000000000002; |
| 31706 | L4_MABX_B.PositionVector[27] = 0.027; |
| 31707 | L4_MABX_B.PositionVector[28] = 0.028; |
| 31708 | L4_MABX_B.PositionVector[29] = 0.029; |
| 31709 | L4_MABX_B.PositionVector[30] = 0.03; |
| 31710 | L4_MABX_B.PositionVector[31] = 0.031; |
| 31711 | L4_MABX_B.PositionVector[32] = 0.032; |
| 31712 | memset(&L4_MABX_B.VelocityVector[0], 0, 33U * sizeof(real_T)); |
| 31713 | memset(&L4_MABX_B.AccelerationVector[0], 0, 33U * sizeof(real_T)); |
| 31714 | memset(&L4_MABX_B.JerkVector[0], 0, 33U * sizeof(real_T)); |
| 31715 | |
| 31716 | /* SystemInitialize for Enabled SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */ |
| 31717 | /* InitializeConditions for UnitDelay: '<S146>/Unit_Delay' */ |
| 31718 | L4_MABX_DW.Unit_Delay_DSTATE_eu = L4_MABX_P.Unit_Delay_InitialCondition_f; |
| 31719 | |
| 31720 | /* InitializeConditions for UnitDelay: '<S153>/Unit_Delay' */ |
| 31721 | L4_MABX_DW.Unit_Delay_DSTATE_n = L4_MABX_P.Unit_Delay_InitialCondition_jb; |
| 31722 | |
| 31723 | /* InitializeConditions for UnitDelay: '<S173>/Unit_Delay1' */ |
| 31724 | L4_MABX_DW.Unit_Delay1_DSTATE_f = L4_MABX_P.Unit_Delay1_InitialCondition_p; |
| 31725 | |
| 31726 | /* InitializeConditions for UnitDelay: '<S174>/Unit_Delay' */ |
| 31727 | L4_MABX_DW.Unit_Delay_DSTATE_g4 = L4_MABX_P.Unit_Delay_InitialCondition_lq; |
| 31728 | |
| 31729 | /* InitializeConditions for UnitDelay: '<S178>/FixPt Unit Delay2' */ |
| 31730 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_o = |
| 31731 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_p; |
| 31732 | |
| 31733 | /* InitializeConditions for UnitDelay: '<S178>/FixPt Unit Delay1' */ |
| 31734 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g2 = |
| 31735 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_b; |
| 31736 | |
| 31737 | /* InitializeConditions for UnitDelay: '<S173>/Unit_Delay2' */ |
| 31738 | L4_MABX_DW.Unit_Delay2_DSTATE_c = L4_MABX_P.Unit_Delay2_InitialCondition_b; |
| 31739 | |
| 31740 | /* InitializeConditions for UnitDelay: '<S145>/Unit_Delay' */ |
| 31741 | L4_MABX_DW.Unit_Delay_DSTATE_h = L4_MABX_P.Unit_Delay_InitialCondition_h; |
| 31742 | |
| 31743 | /* SystemInitialize for Enabled SubSystem: '<S150>/Calculate_D_term' */ |
| 31744 | L4_MA_Calculate_D_term_Init(&L4_MABX_B.Calculate_D_term_p, |
| 31745 | &L4_MABX_DW.Calculate_D_term_p, &L4_MABX_P.Calculate_D_term_p); |
| 31746 | |
| 31747 | /* End of SystemInitialize for SubSystem: '<S150>/Calculate_D_term' */ |
| 31748 | |
| 31749 | /* SystemInitialize for Enabled SubSystem: '<S150>/Calculate_I_term' */ |
| 31750 | L4_MA_Calculate_I_term_Init(&L4_MABX_B.Calculate_I_term_e, |
| 31751 | &L4_MABX_DW.Calculate_I_term_e, &L4_MABX_P.Calculate_I_term_e); |
| 31752 | |
| 31753 | /* End of SystemInitialize for SubSystem: '<S150>/Calculate_I_term' */ |
| 31754 | |
| 31755 | /* SystemInitialize for Outport: '<S103>/PID_output' */ |
| 31756 | L4_MABX_B.If_Then_Else_fo.Switch = L4_MABX_P.PID_output_Y0_p; |
| 31757 | |
| 31758 | /* End of SystemInitialize for SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */ |
| 31759 | |
| 31760 | /* SystemInitialize for Chart: '<S79>/Chart' */ |
| 31761 | L4_MABX_DW.is_active_c19_SUB_L4_Task_10ms_ = 0U; |
| 31762 | L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 31763 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_NOT_AVAILABLE; |
| 31764 | L4_MABX_B.VehCtrlState = ENUM_AUTO_CTRL_VEHICLE_STATE_T_NOT_AVAILABLE; |
| 31765 | |
| 31766 | /* SystemInitialize for Enabled SubSystem: '<S79>/Engine_speed_target' */ |
| 31767 | /* SystemInitialize for Outport: '<S210>/Out1' */ |
| 31768 | L4_MABX_B.MinMax1_n = L4_MABX_P.Out1_Y0; |
| 31769 | |
| 31770 | /* End of SystemInitialize for SubSystem: '<S79>/Engine_speed_target' */ |
| 31771 | |
| 31772 | /* SystemInitialize for Chart: '<S211>/Relay_control_state_machine' */ |
| 31773 | L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 31774 | L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 31775 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 31776 | L4_MABX_DW.is_active_c6_SUB_L4_Task_10ms_S = 0U; |
| 31777 | L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 31778 | |
| 31779 | /* SystemInitialize for Chart: '<S283>/Chart' */ |
| 31780 | L4_MABX_DW.is_active_c12_SUB_L4_Task_10ms_ = 0U; |
| 31781 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 31782 | |
| 31783 | /* SystemInitialize for Enabled SubSystem: '<S283>/Slew_at_event' */ |
| 31784 | /* InitializeConditions for UnitDelay: '<S342>/Unit_Delay' */ |
| 31785 | L4_MABX_DW.Unit_Delay_DSTATE_bd = L4_MABX_P.Unit_Delay_InitialCondition_ls; |
| 31786 | |
| 31787 | /* InitializeConditions for UnitDelay: '<S343>/Unit_Delay' */ |
| 31788 | L4_MABX_DW.Unit_Delay_DSTATE_jt = L4_MABX_P.Unit_Delay_InitialCondition_i0; |
| 31789 | |
| 31790 | /* InitializeConditions for UnitDelay: '<S346>/FixPt Unit Delay2' */ |
| 31791 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_j = |
| 31792 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_c; |
| 31793 | |
| 31794 | /* InitializeConditions for UnitDelay: '<S346>/FixPt Unit Delay1' */ |
| 31795 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_ov = |
| 31796 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_f; |
| 31797 | |
| 31798 | /* InitializeConditions for UnitDelay: '<S341>/Unit_Delay' */ |
| 31799 | L4_MABX_DW.Unit_Delay_DSTATE_ll = L4_MABX_P.Unit_Delay_InitialCondition_ld; |
| 31800 | |
| 31801 | /* SystemInitialize for Outport: '<S340>/F_Out_slewing' */ |
| 31802 | L4_MABX_B.LogicalOperator_dm = L4_MABX_P.F_Out_slewing_Y0; |
| 31803 | |
| 31804 | /* SystemInitialize for Outport: '<S340>/Out' */ |
| 31805 | L4_MABX_B.If_Then_Else_n3.Switch = L4_MABX_P.Out_Y0; |
| 31806 | |
| 31807 | /* End of SystemInitialize for SubSystem: '<S283>/Slew_at_event' */ |
| 31808 | /* End of SystemInitialize for SubSystem: '<S65>/Task_10ms' */ |
| 31809 | |
| 31810 | /* SystemInitialize for Enabled SubSystem: '<S631>/PosRapidUpdate_011' */ |
| 31811 | /* SystemInitialize for Outport: '<S632>/Latitude_' */ |
| 31812 | L4_MABX_B.SFunction1_o1_bh = L4_MABX_P.Latitude_Y0; |
| 31813 | |
| 31814 | /* SystemInitialize for Outport: '<S632>/Longitude_' */ |
| 31815 | L4_MABX_B.SFunction1_o2_db = L4_MABX_P.Longitude_Y0; |
| 31816 | |
| 31817 | /* SystemInitialize for Outport: '<S632>/RX status' */ |
| 31818 | L4_MABX_B.SFunction1_o3_bt = L4_MABX_P.RXstatus_Y0_db; |
| 31819 | |
| 31820 | /* SystemInitialize for Outport: '<S632>/RX time' */ |
| 31821 | L4_MABX_B.SFunction1_o4_ez = L4_MABX_P.RXtime_Y0_b; |
| 31822 | |
| 31823 | /* SystemInitialize for Outport: '<S632>/RX delta time' */ |
| 31824 | L4_MABX_B.SFunction1_o5_gx = L4_MABX_P.RXdeltatime_Y0_h2; |
| 31825 | |
| 31826 | /* End of SystemInitialize for SubSystem: '<S631>/PosRapidUpdate_011' */ |
| 31827 | |
| 31828 | /* SystemInitialize for Enabled SubSystem: '<S631>/PosRapidUpdate_1' */ |
| 31829 | /* SystemInitialize for Outport: '<S633>/Latitude_' */ |
| 31830 | L4_MABX_B.SFunction1_o1_ju = L4_MABX_P.Latitude_Y0_e; |
| 31831 | |
| 31832 | /* SystemInitialize for Outport: '<S633>/Longitude_' */ |
| 31833 | L4_MABX_B.SFunction1_o2_aq = L4_MABX_P.Longitude_Y0_f; |
| 31834 | |
| 31835 | /* SystemInitialize for Outport: '<S633>/RX status' */ |
| 31836 | L4_MABX_B.SFunction1_o3_a = L4_MABX_P.RXstatus_Y0_m5; |
| 31837 | |
| 31838 | /* SystemInitialize for Outport: '<S633>/RX time' */ |
| 31839 | L4_MABX_B.SFunction1_o4_ex = L4_MABX_P.RXtime_Y0_c4; |
| 31840 | |
| 31841 | /* SystemInitialize for Outport: '<S633>/RX delta time' */ |
| 31842 | L4_MABX_B.SFunction1_o5_nb = L4_MABX_P.RXdeltatime_Y0_fd; |
| 31843 | |
| 31844 | /* End of SystemInitialize for SubSystem: '<S631>/PosRapidUpdate_1' */ |
| 31845 | |
| 31846 | /* SystemInitialize for Enabled SubSystem: '<S511>/CCVS1_00' */ |
| 31847 | /* SystemInitialize for Outport: '<S512>/TwoSpeedAxleSwitch' */ |
| 31848 | L4_MABX_B.SFunction1_o1_g3 = L4_MABX_P.TwoSpeedAxleSwitch_Y0; |
| 31849 | |
| 31850 | /* SystemInitialize for Outport: '<S512>/ParkingBrakeSwitch' */ |
| 31851 | L4_MABX_B.SFunction1_o2_g4 = L4_MABX_P.ParkingBrakeSwitch_Y0; |
| 31852 | |
| 31853 | /* SystemInitialize for Outport: '<S512>/CruiseCtrlPauseSwitch' */ |
| 31854 | L4_MABX_B.SFunction1_o3_ne = L4_MABX_P.CruiseCtrlPauseSwitch_Y0; |
| 31855 | |
| 31856 | /* SystemInitialize for Outport: '<S512>/ParkBrakeReleaseInhibitRq' */ |
| 31857 | L4_MABX_B.SFunction1_o4_e3 = L4_MABX_P.ParkBrakeReleaseInhibitRq_Y0; |
| 31858 | |
| 31859 | /* SystemInitialize for Outport: '<S512>/WheelBasedVehicleSpeed' */ |
| 31860 | WheelBasedVehicleSpeed = L4_MABX_P.WheelBasedVehicleSpeed_Y0; |
| 31861 | |
| 31862 | /* SystemInitialize for Outport: '<S512>/CruiseCtrlActive' */ |
| 31863 | L4_MABX_B.SFunction1_o6_oc = L4_MABX_P.CruiseCtrlActive_Y0; |
| 31864 | |
| 31865 | /* SystemInitialize for Outport: '<S512>/CruiseCtrlEnableSwitch' */ |
| 31866 | L4_MABX_B.SFunction1_o7_dk = L4_MABX_P.CruiseCtrlEnableSwitch_Y0; |
| 31867 | |
| 31868 | /* SystemInitialize for Outport: '<S512>/BrakeSwitch' */ |
| 31869 | BrakeSwitch = L4_MABX_P.BrakeSwitch_Y0; |
| 31870 | |
| 31871 | /* SystemInitialize for Outport: '<S512>/ClutchSwitch' */ |
| 31872 | L4_MABX_B.SFunction1_o9_p = L4_MABX_P.ClutchSwitch_Y0; |
| 31873 | |
| 31874 | /* SystemInitialize for Outport: '<S512>/CruiseCtrlSetSwitch' */ |
| 31875 | L4_MABX_B.SFunction1_o10_or = L4_MABX_P.CruiseCtrlSetSwitch_Y0; |
| 31876 | |
| 31877 | /* SystemInitialize for Outport: '<S512>/CruiseCtrlCoastSwitch' */ |
| 31878 | L4_MABX_B.SFunction1_o11_ae = L4_MABX_P.CruiseCtrlCoastSwitch_Y0; |
| 31879 | |
| 31880 | /* SystemInitialize for Outport: '<S512>/CruiseCtrlResumeSwitch' */ |
| 31881 | L4_MABX_B.SFunction1_o12_jy = L4_MABX_P.CruiseCtrlResumeSwitch_Y0; |
| 31882 | |
| 31883 | /* SystemInitialize for Outport: '<S512>/CruiseCtrlAccelerateSwitch' */ |
| 31884 | L4_MABX_B.SFunction1_o13_ou = L4_MABX_P.CruiseCtrlAccelerateSwitch_Y0; |
| 31885 | |
| 31886 | /* SystemInitialize for Outport: '<S512>/CruiseCtrlSetSpeed' */ |
| 31887 | L4_MABX_B.SFunction1_o14_b = L4_MABX_P.CruiseCtrlSetSpeed_Y0; |
| 31888 | |
| 31889 | /* SystemInitialize for Outport: '<S512>/PTOGovernorState' */ |
| 31890 | L4_MABX_B.SFunction1_o15_dd = L4_MABX_P.PTOGovernorState_Y0; |
| 31891 | |
| 31892 | /* SystemInitialize for Outport: '<S512>/CruiseCtrlStates' */ |
| 31893 | L4_MABX_B.SFunction1_o16_g = L4_MABX_P.CruiseCtrlStates_Y0; |
| 31894 | |
| 31895 | /* SystemInitialize for Outport: '<S512>/EngIdleIncrementSwitch' */ |
| 31896 | L4_MABX_B.SFunction1_o17_n = L4_MABX_P.EngIdleIncrementSwitch_Y0; |
| 31897 | |
| 31898 | /* SystemInitialize for Outport: '<S512>/EngIdleDecrementSwitch' */ |
| 31899 | L4_MABX_B.SFunction1_o18_g = L4_MABX_P.EngIdleDecrementSwitch_Y0; |
| 31900 | |
| 31901 | /* SystemInitialize for Outport: '<S512>/EngTestModeSwitch' */ |
| 31902 | L4_MABX_B.SFunction1_o19_a = L4_MABX_P.EngTestModeSwitch_Y0; |
| 31903 | |
| 31904 | /* SystemInitialize for Outport: '<S512>/EngShutdownOverrideSwitch' */ |
| 31905 | L4_MABX_B.SFunction1_o20_ir = L4_MABX_P.EngShutdownOverrideSwitch_Y0; |
| 31906 | |
| 31907 | /* SystemInitialize for Outport: '<S512>/RX status' */ |
| 31908 | L4_MABX_B.SFunction1_o21_j = L4_MABX_P.RXstatus_Y0_p; |
| 31909 | |
| 31910 | /* SystemInitialize for Outport: '<S512>/RX time' */ |
| 31911 | L4_MABX_B.SFunction1_o22_oy = L4_MABX_P.RXtime_Y0_a; |
| 31912 | |
| 31913 | /* SystemInitialize for Outport: '<S512>/RX delta time' */ |
| 31914 | L4_MABX_B.SFunction1_o23_o = L4_MABX_P.RXdeltatime_Y0_j; |
| 31915 | |
| 31916 | /* End of SystemInitialize for SubSystem: '<S511>/CCVS1_00' */ |
| 31917 | |
| 31918 | /* SystemInitialize for Enabled SubSystem: '<S515>/COGSOGRapidUpdate_00' */ |
| 31919 | /* SystemInitialize for Outport: '<S516>/SID' */ |
| 31920 | L4_MABX_B.SFunction1_o1_nq = L4_MABX_P.SID_Y0; |
| 31921 | |
| 31922 | /* SystemInitialize for Outport: '<S516>/COGReference' */ |
| 31923 | L4_MABX_B.SFunction1_o2_co = L4_MABX_P.COGReference_Y0; |
| 31924 | |
| 31925 | /* SystemInitialize for Outport: '<S516>/CourseOverGround' */ |
| 31926 | L4_MABX_B.SFunction1_o3_at = L4_MABX_P.CourseOverGround_Y0; |
| 31927 | |
| 31928 | /* SystemInitialize for Outport: '<S516>/SpeedOverGround' */ |
| 31929 | L4_MABX_B.SFunction1_o4_az = L4_MABX_P.SpeedOverGround_Y0; |
| 31930 | |
| 31931 | /* SystemInitialize for Outport: '<S516>/RX status' */ |
| 31932 | L4_MABX_B.SFunction1_o5_nx = L4_MABX_P.RXstatus_Y0_o; |
| 31933 | |
| 31934 | /* SystemInitialize for Outport: '<S516>/RX time' */ |
| 31935 | L4_MABX_B.SFunction1_o6_ez = L4_MABX_P.RXtime_Y0_ic; |
| 31936 | |
| 31937 | /* SystemInitialize for Outport: '<S516>/RX delta time' */ |
| 31938 | L4_MABX_B.SFunction1_o7_j = L4_MABX_P.RXdeltatime_Y0_d; |
| 31939 | |
| 31940 | /* End of SystemInitialize for SubSystem: '<S515>/COGSOGRapidUpdate_00' */ |
| 31941 | |
| 31942 | /* SystemInitialize for Enabled SubSystem: '<S515>/COGSOGRapidUpdate_1' */ |
| 31943 | /* SystemInitialize for Outport: '<S517>/SID' */ |
| 31944 | L4_MABX_B.SFunction1_o1_ar = L4_MABX_P.SID_Y0_j; |
| 31945 | |
| 31946 | /* SystemInitialize for Outport: '<S517>/COGReference' */ |
| 31947 | L4_MABX_B.SFunction1_o2_p0 = L4_MABX_P.COGReference_Y0_p; |
| 31948 | |
| 31949 | /* SystemInitialize for Outport: '<S517>/CourseOverGround' */ |
| 31950 | L4_MABX_B.SFunction1_o3_adq = L4_MABX_P.CourseOverGround_Y0_j; |
| 31951 | |
| 31952 | /* SystemInitialize for Outport: '<S517>/SpeedOverGround' */ |
| 31953 | L4_MABX_B.SFunction1_o4_gf = L4_MABX_P.SpeedOverGround_Y0_a; |
| 31954 | |
| 31955 | /* SystemInitialize for Outport: '<S517>/RX status' */ |
| 31956 | L4_MABX_B.SFunction1_o5_f1p = L4_MABX_P.RXstatus_Y0_od; |
| 31957 | |
| 31958 | /* SystemInitialize for Outport: '<S517>/RX time' */ |
| 31959 | L4_MABX_B.SFunction1_o6_f = L4_MABX_P.RXtime_Y0_ld; |
| 31960 | |
| 31961 | /* SystemInitialize for Outport: '<S517>/RX delta time' */ |
| 31962 | L4_MABX_B.SFunction1_o7_bu = L4_MABX_P.RXdeltatime_Y0_n1; |
| 31963 | |
| 31964 | /* End of SystemInitialize for SubSystem: '<S515>/COGSOGRapidUpdate_1' */ |
| 31965 | |
| 31966 | /* SystemInitialize for Atomic SubSystem: '<S855>/CAN_TX_100ms' */ |
| 31967 | /* SystemInitialize for Enabled SubSystem: '<S892>/Rolling_15_counter' */ |
| 31968 | /* InitializeConditions for UnitDelay: '<S934>/Unit_Delay' */ |
| 31969 | L4_MABX_DW.Unit_Delay_DSTATE = L4_MABX_P.Unit_Delay_InitialCondition_bv; |
| 31970 | |
| 31971 | /* SystemInitialize for Outport: '<S934>/Rolling_15_counter' */ |
| 31972 | L4_MABX_B.Unit_Delay = L4_MABX_P.Rolling_15_counter_Y0; |
| 31973 | |
| 31974 | /* End of SystemInitialize for SubSystem: '<S892>/Rolling_15_counter' */ |
| 31975 | |
| 31976 | /* SystemInitialize for Enabled SubSystem: '<S914>/PropB_XPR_FC' */ |
| 31977 | /* SystemInitialize for Outport: '<S916>/TX status' */ |
| 31978 | L4_MABX_B.SFunction1_o1_n = L4_MABX_P.TXstatus_Y0_o; |
| 31979 | |
| 31980 | /* SystemInitialize for Outport: '<S916>/TX time' */ |
| 31981 | L4_MABX_B.SFunction1_o2_du = L4_MABX_P.TXtime_Y0_jw; |
| 31982 | |
| 31983 | /* SystemInitialize for Outport: '<S916>/TX delta time' */ |
| 31984 | L4_MABX_B.SFunction1_o3_b1 = L4_MABX_P.TXdeltatime_Y0_n; |
| 31985 | |
| 31986 | /* SystemInitialize for Outport: '<S916>/TX delay time' */ |
| 31987 | L4_MABX_B.SFunction1_o4_o = L4_MABX_P.TXdelaytime_Y0_k; |
| 31988 | |
| 31989 | /* End of SystemInitialize for SubSystem: '<S914>/PropB_XPR_FC' */ |
| 31990 | |
| 31991 | /* SystemInitialize for Enabled SubSystem: '<S915>/PropB_XPR_FC' */ |
| 31992 | /* SystemInitialize for Outport: '<S917>/TX status' */ |
| 31993 | L4_MABX_B.SFunction1_o1_fy = L4_MABX_P.TXstatus_Y0_j; |
| 31994 | |
| 31995 | /* SystemInitialize for Outport: '<S917>/TX time' */ |
| 31996 | L4_MABX_B.SFunction1_o2_l = L4_MABX_P.TXtime_Y0_e; |
| 31997 | |
| 31998 | /* SystemInitialize for Outport: '<S917>/TX delta time' */ |
| 31999 | L4_MABX_B.SFunction1_o3_f0 = L4_MABX_P.TXdeltatime_Y0_nq; |
| 32000 | |
| 32001 | /* SystemInitialize for Outport: '<S917>/TX delay time' */ |
| 32002 | L4_MABX_B.SFunction1_o4_p = L4_MABX_P.TXdelaytime_Y0_gr; |
| 32003 | |
| 32004 | /* End of SystemInitialize for SubSystem: '<S915>/PropB_XPR_FC' */ |
| 32005 | |
| 32006 | /* SystemInitialize for Enabled SubSystem: '<S944>/Std_PosRapidUpdate_01' */ |
| 32007 | /* SystemInitialize for Outport: '<S945>/TX status' */ |
| 32008 | L4_MABX_B.SFunction1_o1_lh = L4_MABX_P.TXstatus_Y0_c1; |
| 32009 | |
| 32010 | /* SystemInitialize for Outport: '<S945>/TX time' */ |
| 32011 | L4_MABX_B.SFunction1_o2_b0 = L4_MABX_P.TXtime_Y0_i; |
| 32012 | |
| 32013 | /* SystemInitialize for Outport: '<S945>/TX delta time' */ |
| 32014 | L4_MABX_B.SFunction1_o3_bz = L4_MABX_P.TXdeltatime_Y0_m; |
| 32015 | |
| 32016 | /* SystemInitialize for Outport: '<S945>/TX delay time' */ |
| 32017 | L4_MABX_B.SFunction1_o4_n3 = L4_MABX_P.TXdelaytime_Y0_h; |
| 32018 | |
| 32019 | /* End of SystemInitialize for SubSystem: '<S944>/Std_PosRapidUpdate_01' */ |
| 32020 | |
| 32021 | /* SystemInitialize for Enabled SubSystem: '<S894>/CCVS1_00' */ |
| 32022 | /* SystemInitialize for Outport: '<S896>/TX status' */ |
| 32023 | L4_MABX_B.SFunction1_o1_c = L4_MABX_P.TXstatus_Y0_a; |
| 32024 | |
| 32025 | /* SystemInitialize for Outport: '<S896>/TX time' */ |
| 32026 | L4_MABX_B.SFunction1_o2_oc = L4_MABX_P.TXtime_Y0_l; |
| 32027 | |
| 32028 | /* SystemInitialize for Outport: '<S896>/TX delta time' */ |
| 32029 | L4_MABX_B.SFunction1_o3_h = L4_MABX_P.TXdeltatime_Y0_o; |
| 32030 | |
| 32031 | /* SystemInitialize for Outport: '<S896>/TX delay time' */ |
| 32032 | L4_MABX_B.SFunction1_o4_hr = L4_MABX_P.TXdelaytime_Y0_p; |
| 32033 | |
| 32034 | /* End of SystemInitialize for SubSystem: '<S894>/CCVS1_00' */ |
| 32035 | |
| 32036 | /* SystemInitialize for Enabled SubSystem: '<S895>/CCVS1_00' */ |
| 32037 | /* SystemInitialize for Outport: '<S897>/TX status' */ |
| 32038 | L4_MABX_B.SFunction1_o1_i = L4_MABX_P.TXstatus_Y0_p; |
| 32039 | |
| 32040 | /* SystemInitialize for Outport: '<S897>/TX time' */ |
| 32041 | L4_MABX_B.SFunction1_o2_gv = L4_MABX_P.TXtime_Y0_j; |
| 32042 | |
| 32043 | /* SystemInitialize for Outport: '<S897>/TX delta time' */ |
| 32044 | L4_MABX_B.SFunction1_o3_j = L4_MABX_P.TXdeltatime_Y0_f; |
| 32045 | |
| 32046 | /* SystemInitialize for Outport: '<S897>/TX delay time' */ |
| 32047 | L4_MABX_B.SFunction1_o4_fm = L4_MABX_P.TXdelaytime_Y0_e; |
| 32048 | |
| 32049 | /* End of SystemInitialize for SubSystem: '<S895>/CCVS1_00' */ |
| 32050 | |
| 32051 | /* SystemInitialize for Enabled SubSystem: '<S898>/PropB_REAX_5_E4' */ |
| 32052 | /* SystemInitialize for Outport: '<S900>/TX status' */ |
| 32053 | L4_MABX_B.SFunction1_o1_a3 = L4_MABX_P.TXstatus_Y0_c; |
| 32054 | |
| 32055 | /* SystemInitialize for Outport: '<S900>/TX time' */ |
| 32056 | L4_MABX_B.SFunction1_o2_ob = L4_MABX_P.TXtime_Y0_f; |
| 32057 | |
| 32058 | /* SystemInitialize for Outport: '<S900>/TX delta time' */ |
| 32059 | L4_MABX_B.SFunction1_o3_bj = L4_MABX_P.TXdeltatime_Y0_a; |
| 32060 | |
| 32061 | /* SystemInitialize for Outport: '<S900>/TX delay time' */ |
| 32062 | L4_MABX_B.SFunction1_o4_kp = L4_MABX_P.TXdelaytime_Y0_j; |
| 32063 | |
| 32064 | /* End of SystemInitialize for SubSystem: '<S898>/PropB_REAX_5_E4' */ |
| 32065 | |
| 32066 | /* SystemInitialize for Enabled SubSystem: '<S899>/PropB_REAX_5_E4' */ |
| 32067 | /* SystemInitialize for Outport: '<S901>/TX status' */ |
| 32068 | L4_MABX_B.SFunction1_o1_nz = L4_MABX_P.TXstatus_Y0_au; |
| 32069 | |
| 32070 | /* SystemInitialize for Outport: '<S901>/TX time' */ |
| 32071 | L4_MABX_B.SFunction1_o2_ed = L4_MABX_P.TXtime_Y0_l2; |
| 32072 | |
| 32073 | /* SystemInitialize for Outport: '<S901>/TX delta time' */ |
| 32074 | L4_MABX_B.SFunction1_o3_o = L4_MABX_P.TXdeltatime_Y0_h; |
| 32075 | |
| 32076 | /* SystemInitialize for Outport: '<S901>/TX delay time' */ |
| 32077 | L4_MABX_B.SFunction1_o4_k = L4_MABX_P.TXdelaytime_Y0_f; |
| 32078 | |
| 32079 | /* End of SystemInitialize for SubSystem: '<S899>/PropB_REAX_5_E4' */ |
| 32080 | |
| 32081 | /* SystemInitialize for Enabled SubSystem: '<S918>/Std_COGSOGRapidUpdate_01' */ |
| 32082 | /* SystemInitialize for Outport: '<S919>/TX status' */ |
| 32083 | L4_MABX_B.SFunction1_o1_oy = L4_MABX_P.TXstatus_Y0_p3; |
| 32084 | |
| 32085 | /* SystemInitialize for Outport: '<S919>/TX time' */ |
| 32086 | L4_MABX_B.SFunction1_o2_jm = L4_MABX_P.TXtime_Y0_g; |
| 32087 | |
| 32088 | /* SystemInitialize for Outport: '<S919>/TX delta time' */ |
| 32089 | L4_MABX_B.SFunction1_o3_lx = L4_MABX_P.TXdeltatime_Y0_b; |
| 32090 | |
| 32091 | /* SystemInitialize for Outport: '<S919>/TX delay time' */ |
| 32092 | L4_MABX_B.SFunction1_o4_fwb = L4_MABX_P.TXdelaytime_Y0_g0; |
| 32093 | |
| 32094 | /* End of SystemInitialize for SubSystem: '<S918>/Std_COGSOGRapidUpdate_01' */ |
| 32095 | |
| 32096 | /* SystemInitialize for Enabled SubSystem: '<S920>/EBC1_TX' */ |
| 32097 | /* SystemInitialize for Outport: '<S921>/TX status' */ |
| 32098 | L4_MABX_B.SFunction1_o1_fc = L4_MABX_P.TXstatus_Y0_jr; |
| 32099 | |
| 32100 | /* SystemInitialize for Outport: '<S921>/TX time' */ |
| 32101 | L4_MABX_B.SFunction1_o2_km = L4_MABX_P.TXtime_Y0_d; |
| 32102 | |
| 32103 | /* SystemInitialize for Outport: '<S921>/TX delta time' */ |
| 32104 | L4_MABX_B.SFunction1_o3_bb = L4_MABX_P.TXdeltatime_Y0_c; |
| 32105 | |
| 32106 | /* SystemInitialize for Outport: '<S921>/TX delay time' */ |
| 32107 | L4_MABX_B.SFunction1_o4_b = L4_MABX_P.TXdelaytime_Y0_i; |
| 32108 | |
| 32109 | /* End of SystemInitialize for SubSystem: '<S920>/EBC1_TX' */ |
| 32110 | /* End of SystemInitialize for SubSystem: '<S855>/CAN_TX_100ms' */ |
| 32111 | |
| 32112 | /* SystemInitialize for Atomic SubSystem: '<S855>/CAN_TX_10ms' */ |
| 32113 | /* InitializeConditions for UnitDelay: '<S1012>/Unit_Delay' */ |
| 32114 | L4_MABX_DW.Unit_Delay_DSTATE_mr = L4_MABX_P.Unit_Delay_InitialCondition_mj; |
| 32115 | |
| 32116 | /* InitializeConditions for UnitDelay: '<S1013>/Unit Delay' */ |
| 32117 | L4_MABX_DW.UnitDelay_DSTATE_c = L4_MABX_P.UnitDelay_InitialCondition_le; |
| 32118 | |
| 32119 | /* SystemInitialize for Enabled SubSystem: '<S957>/ACCS' */ |
| 32120 | /* SystemInitialize for Outport: '<S958>/TX status' */ |
| 32121 | L4_MABX_B.SFunction1_o1_h = L4_MABX_P.TXstatus_Y0_m; |
| 32122 | |
| 32123 | /* SystemInitialize for Outport: '<S958>/TX time' */ |
| 32124 | L4_MABX_B.SFunction1_o2_j = L4_MABX_P.TXtime_Y0_m; |
| 32125 | |
| 32126 | /* SystemInitialize for Outport: '<S958>/TX delta time' */ |
| 32127 | L4_MABX_B.SFunction1_o3_br = L4_MABX_P.TXdeltatime_Y0_j; |
| 32128 | |
| 32129 | /* SystemInitialize for Outport: '<S958>/TX delay time' */ |
| 32130 | L4_MABX_B.SFunction1_o4_d = L4_MABX_P.TXdelaytime_Y0_ed; |
| 32131 | |
| 32132 | /* End of SystemInitialize for SubSystem: '<S957>/ACCS' */ |
| 32133 | |
| 32134 | /* SystemInitialize for Enabled SubSystem: '<S965>/EEC1_00' */ |
| 32135 | /* SystemInitialize for Outport: '<S967>/TX status' */ |
| 32136 | L4_MABX_B.SFunction1_o1_kl = L4_MABX_P.TXstatus_Y0_d; |
| 32137 | |
| 32138 | /* SystemInitialize for Outport: '<S967>/TX time' */ |
| 32139 | L4_MABX_B.SFunction1_o2_o = L4_MABX_P.TXtime_Y0_fw; |
| 32140 | |
| 32141 | /* SystemInitialize for Outport: '<S967>/TX delta time' */ |
| 32142 | L4_MABX_B.SFunction1_o3_bv = L4_MABX_P.TXdeltatime_Y0_p; |
| 32143 | |
| 32144 | /* SystemInitialize for Outport: '<S967>/TX delay time' */ |
| 32145 | L4_MABX_B.SFunction1_o4_e5 = L4_MABX_P.TXdelaytime_Y0_c; |
| 32146 | |
| 32147 | /* End of SystemInitialize for SubSystem: '<S965>/EEC1_00' */ |
| 32148 | |
| 32149 | /* SystemInitialize for Enabled SubSystem: '<S966>/EEC1_00' */ |
| 32150 | /* SystemInitialize for Outport: '<S968>/TX status' */ |
| 32151 | L4_MABX_B.SFunction1_o1_la = L4_MABX_P.TXstatus_Y0_n; |
| 32152 | |
| 32153 | /* SystemInitialize for Outport: '<S968>/TX time' */ |
| 32154 | L4_MABX_B.SFunction1_o2_b = L4_MABX_P.TXtime_Y0_mj; |
| 32155 | |
| 32156 | /* SystemInitialize for Outport: '<S968>/TX delta time' */ |
| 32157 | L4_MABX_B.SFunction1_o3_i1 = L4_MABX_P.TXdeltatime_Y0_iq; |
| 32158 | |
| 32159 | /* SystemInitialize for Outport: '<S968>/TX delay time' */ |
| 32160 | L4_MABX_B.SFunction1_o4_mk = L4_MABX_P.TXdelaytime_Y0_a; |
| 32161 | |
| 32162 | /* End of SystemInitialize for SubSystem: '<S966>/EEC1_00' */ |
| 32163 | |
| 32164 | /* SystemInitialize for Merge: '<S983>/Merge' */ |
| 32165 | L4_MABX_B.Merge = L4_MABX_P.Merge_InitialOutput; |
| 32166 | |
| 32167 | /* SystemInitialize for Enabled SubSystem: '<S969>/PropB_REAX_1_E4' */ |
| 32168 | /* SystemInitialize for Outport: '<S971>/TX status' */ |
| 32169 | L4_MABX_B.SFunction1_o1_oc = L4_MABX_P.TXstatus_Y0_e; |
| 32170 | |
| 32171 | /* SystemInitialize for Outport: '<S971>/TX time' */ |
| 32172 | L4_MABX_B.SFunction1_o2_c = L4_MABX_P.TXtime_Y0_p; |
| 32173 | |
| 32174 | /* SystemInitialize for Outport: '<S971>/TX delta time' */ |
| 32175 | L4_MABX_B.SFunction1_o3_f = L4_MABX_P.TXdeltatime_Y0_e; |
| 32176 | |
| 32177 | /* SystemInitialize for Outport: '<S971>/TX delay time' */ |
| 32178 | L4_MABX_B.SFunction1_o4_n = L4_MABX_P.TXdelaytime_Y0_ks; |
| 32179 | |
| 32180 | /* End of SystemInitialize for SubSystem: '<S969>/PropB_REAX_1_E4' */ |
| 32181 | |
| 32182 | /* SystemInitialize for Enabled SubSystem: '<S970>/PropB_REAX_1_E4' */ |
| 32183 | /* SystemInitialize for Outport: '<S972>/TX status' */ |
| 32184 | L4_MABX_B.SFunction1_o1_m = L4_MABX_P.TXstatus_Y0_eu; |
| 32185 | |
| 32186 | /* SystemInitialize for Outport: '<S972>/TX time' */ |
| 32187 | L4_MABX_B.SFunction1_o2_gj = L4_MABX_P.TXtime_Y0_k; |
| 32188 | |
| 32189 | /* SystemInitialize for Outport: '<S972>/TX delta time' */ |
| 32190 | L4_MABX_B.SFunction1_o3_mj = L4_MABX_P.TXdeltatime_Y0_g; |
| 32191 | |
| 32192 | /* SystemInitialize for Outport: '<S972>/TX delay time' */ |
| 32193 | L4_MABX_B.SFunction1_o4_j = L4_MABX_P.TXdelaytime_Y0_ho; |
| 32194 | |
| 32195 | /* End of SystemInitialize for SubSystem: '<S970>/PropB_REAX_1_E4' */ |
| 32196 | |
| 32197 | /* SystemInitialize for Enabled SubSystem: '<S979>/VDC2_0B' */ |
| 32198 | /* SystemInitialize for Outport: '<S980>/TX status' */ |
| 32199 | L4_MABX_B.SFunction1_o1_l1 = L4_MABX_P.TXstatus_Y0_i; |
| 32200 | |
| 32201 | /* SystemInitialize for Outport: '<S980>/TX time' */ |
| 32202 | L4_MABX_B.SFunction1_o2_er = L4_MABX_P.TXtime_Y0_jm; |
| 32203 | |
| 32204 | /* SystemInitialize for Outport: '<S980>/TX delta time' */ |
| 32205 | L4_MABX_B.SFunction1_o3_bp = L4_MABX_P.TXdeltatime_Y0_g0; |
| 32206 | |
| 32207 | /* SystemInitialize for Outport: '<S980>/TX delay time' */ |
| 32208 | L4_MABX_B.SFunction1_o4_m = L4_MABX_P.TXdelaytime_Y0_d; |
| 32209 | |
| 32210 | /* End of SystemInitialize for SubSystem: '<S979>/VDC2_0B' */ |
| 32211 | /* End of SystemInitialize for SubSystem: '<S855>/CAN_TX_10ms' */ |
| 32212 | |
| 32213 | /* SystemInitialize for Atomic SubSystem: '<S855>/CAN_TX_20ms' */ |
| 32214 | /* InitializeConditions for UnitDelay: '<S1017>/Unit_Delay' */ |
| 32215 | L4_MABX_DW.Unit_Delay_DSTATE_j5 = L4_MABX_P.Unit_Delay_InitialCondition_dp; |
| 32216 | |
| 32217 | /* InitializeConditions for UnitDelay: '<S1040>/Unit_Delay' */ |
| 32218 | L4_MABX_DW.Unit_Delay_DSTATE_f3 = L4_MABX_P.Unit_Delay_InitialCondition_ir; |
| 32219 | |
| 32220 | /* InitializeConditions for UnitDelay: '<S1041>/Unit Delay' */ |
| 32221 | L4_MABX_DW.UnitDelay_DSTATE_em = L4_MABX_P.UnitDelay_InitialCondition_b; |
| 32222 | |
| 32223 | /* SystemInitialize for Enabled SubSystem: '<S1024>/PropB_XBR_B3' */ |
| 32224 | /* SystemInitialize for Outport: '<S1025>/TX status' */ |
| 32225 | L4_MABX_B.SFunction1_o1_jl = L4_MABX_P.TXstatus_Y0_av; |
| 32226 | |
| 32227 | /* SystemInitialize for Outport: '<S1025>/TX time' */ |
| 32228 | L4_MABX_B.SFunction1_o2_ph = L4_MABX_P.TXtime_Y0_f4; |
| 32229 | |
| 32230 | /* SystemInitialize for Outport: '<S1025>/TX delta time' */ |
| 32231 | L4_MABX_B.SFunction1_o3_b = L4_MABX_P.TXdeltatime_Y0_ct; |
| 32232 | |
| 32233 | /* SystemInitialize for Outport: '<S1025>/TX delay time' */ |
| 32234 | L4_MABX_B.SFunction1_o4_g = L4_MABX_P.TXdelaytime_Y0_kk; |
| 32235 | |
| 32236 | /* End of SystemInitialize for SubSystem: '<S1024>/PropB_XBR_B3' */ |
| 32237 | |
| 32238 | /* SystemInitialize for Enabled SubSystem: '<S1026>/PropB_Bendix_2C2_XPR' */ |
| 32239 | /* SystemInitialize for Outport: '<S1027>/TX status' */ |
| 32240 | L4_MABX_B.SFunction1_o1_e = L4_MABX_P.TXstatus_Y0_pq; |
| 32241 | |
| 32242 | /* SystemInitialize for Outport: '<S1027>/TX time' */ |
| 32243 | L4_MABX_B.SFunction1_o2_g = L4_MABX_P.TXtime_Y0_fx; |
| 32244 | |
| 32245 | /* SystemInitialize for Outport: '<S1027>/TX delta time' */ |
| 32246 | L4_MABX_B.SFunction1_o3_d = L4_MABX_P.TXdeltatime_Y0_gj; |
| 32247 | |
| 32248 | /* SystemInitialize for Outport: '<S1027>/TX delay time' */ |
| 32249 | L4_MABX_B.SFunction1_o4_fw = L4_MABX_P.TXdelaytime_Y0_l; |
| 32250 | |
| 32251 | /* End of SystemInitialize for SubSystem: '<S1026>/PropB_Bendix_2C2_XPR' */ |
| 32252 | |
| 32253 | /* SystemInitialize for Enabled SubSystem: '<S1034>/Std_OdometryData' */ |
| 32254 | /* SystemInitialize for Outport: '<S1035>/TX status' */ |
| 32255 | L4_MABX_B.SFunction1_o1_b = L4_MABX_P.TXstatus_Y0_ag; |
| 32256 | |
| 32257 | /* SystemInitialize for Outport: '<S1035>/TX time' */ |
| 32258 | L4_MABX_B.SFunction1_o2_f = L4_MABX_P.TXtime_Y0_fu; |
| 32259 | |
| 32260 | /* SystemInitialize for Outport: '<S1035>/TX delta time' */ |
| 32261 | L4_MABX_B.SFunction1_o3_ed = L4_MABX_P.TXdeltatime_Y0_nc; |
| 32262 | |
| 32263 | /* SystemInitialize for Outport: '<S1035>/TX delay time' */ |
| 32264 | L4_MABX_B.SFunction1_o4_fk = L4_MABX_P.TXdelaytime_Y0_en; |
| 32265 | |
| 32266 | /* End of SystemInitialize for SubSystem: '<S1034>/Std_OdometryData' */ |
| 32267 | /* End of SystemInitialize for SubSystem: '<S855>/CAN_TX_20ms' */ |
| 32268 | |
| 32269 | /* SystemInitialize for Atomic SubSystem: '<S855>/CAN_TX_5000ms' */ |
| 32270 | /* InitializeConditions for UnitDelay: '<S1055>/Unit_Delay' */ |
| 32271 | L4_MABX_DW.Unit_Delay_DSTATE_a = L4_MABX_P.Unit_Delay_InitialCondition_ew; |
| 32272 | |
| 32273 | /* InitializeConditions for UnitDelay: '<S1056>/Unit Delay' */ |
| 32274 | L4_MABX_DW.UnitDelay_DSTATE_a = L4_MABX_P.UnitDelay_InitialCondition_j; |
| 32275 | |
| 32276 | /* SystemInitialize for Enabled SubSystem: '<S1049>/RQST_13_E4' */ |
| 32277 | /* SystemInitialize for Outport: '<S1051>/TX status' */ |
| 32278 | L4_MABX_B.SFunction1_o1_p = L4_MABX_P.TXstatus_Y0_h; |
| 32279 | |
| 32280 | /* SystemInitialize for Outport: '<S1051>/TX time' */ |
| 32281 | L4_MABX_B.SFunction1_o2_k = L4_MABX_P.TXtime_Y0_gk; |
| 32282 | |
| 32283 | /* SystemInitialize for Outport: '<S1051>/TX delta time' */ |
| 32284 | L4_MABX_B.SFunction1_o3_i = L4_MABX_P.TXdeltatime_Y0_eb; |
| 32285 | |
| 32286 | /* SystemInitialize for Outport: '<S1051>/TX delay time' */ |
| 32287 | L4_MABX_B.SFunction1_o4_e = L4_MABX_P.TXdelaytime_Y0_b; |
| 32288 | |
| 32289 | /* End of SystemInitialize for SubSystem: '<S1049>/RQST_13_E4' */ |
| 32290 | /* End of SystemInitialize for SubSystem: '<S855>/CAN_TX_5000ms' */ |
| 32291 | |
| 32292 | /* SystemInitialize for Enabled SubSystem: '<S646>/TC1_03_05' */ |
| 32293 | /* SystemInitialize for Outport: '<S647>/SPN681_TransGearShiftInhibitReq' */ |
| 32294 | L4_MABX_B.SFunction1_o1_iz = L4_MABX_P.SPN681_TransGearShiftInhibitReq; |
| 32295 | |
| 32296 | /* SystemInitialize for Outport: '<S647>/SPN682_TransTrqConvLockupDisReq' */ |
| 32297 | L4_MABX_B.SFunction1_o2_k5 = L4_MABX_P.SPN682_TransTrqConvLockupDisReq; |
| 32298 | |
| 32299 | /* SystemInitialize for Outport: '<S647>/SPN683_DisengageDrivelineReq' */ |
| 32300 | L4_MABX_B.SFunction1_o3_edr = L4_MABX_P.SPN683_DisengageDrivelineReq_Y0; |
| 32301 | |
| 32302 | /* SystemInitialize for Outport: '<S647>/SPN4242_TransRevGearShiftInhibRq' */ |
| 32303 | L4_MABX_B.SFunction1_o4_lb = L4_MABX_P.SPN4242_TransRevGearShiftInhibR; |
| 32304 | |
| 32305 | /* SystemInitialize for Outport: '<S647>/SPN684_RequestedPercClutchSlip' */ |
| 32306 | L4_MABX_B.SFunction1_o5_n = L4_MABX_P.SPN684_RequestedPercClutchSlip_; |
| 32307 | |
| 32308 | /* SystemInitialize for Outport: '<S647>/SPN525_TransRequestedGear' */ |
| 32309 | L4_MABX_B.SFunction1_o6_b = L4_MABX_P.SPN525_TransRequestedGear_Y0; |
| 32310 | |
| 32311 | /* SystemInitialize for Outport: '<S647>/SPN685_DisengageDiffLockRqFrAx1' */ |
| 32312 | L4_MABX_B.SFunction1_o7_c = L4_MABX_P.SPN685_DisengageDiffLockRqFrAx1; |
| 32313 | |
| 32314 | /* SystemInitialize for Outport: '<S647>/SPN686_DisengageDiffLockRqFrAx2' */ |
| 32315 | L4_MABX_B.SFunction1_o8_l = L4_MABX_P.SPN686_DisengageDiffLockRqFrAx2; |
| 32316 | |
| 32317 | /* SystemInitialize for Outport: '<S647>/SPN687_DisengageDiffLockRqRrAx1' */ |
| 32318 | L4_MABX_B.SFunction1_o9_j = L4_MABX_P.SPN687_DisengageDiffLockRqRrAx1; |
| 32319 | |
| 32320 | /* SystemInitialize for Outport: '<S647>/SPN688_DisengageDiffLockRqRrAx2' */ |
| 32321 | L4_MABX_B.SFunction1_o10_h = L4_MABX_P.SPN688_DisengageDiffLockRqRrAx2; |
| 32322 | |
| 32323 | /* SystemInitialize for Outport: '<S647>/SPN689_DisengageDiffLockRqC' */ |
| 32324 | L4_MABX_B.SFunction1_o11 = L4_MABX_P.SPN689_DisengageDiffLockRqC_Y0; |
| 32325 | |
| 32326 | /* SystemInitialize for Outport: '<S647>/SPN690_DisengageDiffLockRqCF' */ |
| 32327 | L4_MABX_B.SFunction1_o12 = L4_MABX_P.SPN690_DisengageDiffLockRqCF_Y0; |
| 32328 | |
| 32329 | /* SystemInitialize for Outport: '<S647>/SPN691_DisengageDiffLockRqCR' */ |
| 32330 | L4_MABX_B.SFunction1_o13 = L4_MABX_P.SPN691_DisengageDiffLockRqCR_Y0; |
| 32331 | |
| 32332 | /* SystemInitialize for Outport: '<S647>/SPN5762_TransLoadRedInhibitRq' */ |
| 32333 | L4_MABX_B.SFunction1_o14 = L4_MABX_P.SPN5762_TransLoadRedInhibitRq_Y; |
| 32334 | |
| 32335 | /* SystemInitialize for Outport: '<S647>/SPN1852_TransmissionMode1' */ |
| 32336 | L4_MABX_B.SFunction1_o15 = L4_MABX_P.SPN1852_TransmissionMode1_Y0; |
| 32337 | |
| 32338 | /* SystemInitialize for Outport: '<S647>/SPN1853_TransmissionMode2' */ |
| 32339 | L4_MABX_B.SFunction1_o16 = L4_MABX_P.SPN1853_TransmissionMode2_Y0; |
| 32340 | |
| 32341 | /* SystemInitialize for Outport: '<S647>/SPN1854_TransmissionMode3' */ |
| 32342 | L4_MABX_B.SFunction1_o17 = L4_MABX_P.SPN1854_TransmissionMode3_Y0; |
| 32343 | |
| 32344 | /* SystemInitialize for Outport: '<S647>/SPN1855_TransmissionMode4' */ |
| 32345 | L4_MABX_B.SFunction1_o18 = L4_MABX_P.SPN1855_TransmissionMode4_Y0; |
| 32346 | |
| 32347 | /* SystemInitialize for Outport: '<S647>/SPN7695_TransAutoNeutralRequest' */ |
| 32348 | L4_MABX_B.SFunction1_o19 = L4_MABX_P.SPN7695_TransAutoNeutralRequest; |
| 32349 | |
| 32350 | /* SystemInitialize for Outport: '<S647>/SPN4255_TransRequestedLaunchGear' */ |
| 32351 | L4_MABX_B.SFunction1_o20 = L4_MABX_P.SPN4255_TransRequestedLaunchGea; |
| 32352 | |
| 32353 | /* SystemInitialize for Outport: '<S647>/SPN2985_TransShiftSelDispModeSw' */ |
| 32354 | L4_MABX_B.SFunction1_o21 = L4_MABX_P.SPN2985_TransShiftSelDispModeSw; |
| 32355 | |
| 32356 | /* SystemInitialize for Outport: '<S647>/SPN4246_TransmissionMode5' */ |
| 32357 | L4_MABX_B.SFunction1_o22 = L4_MABX_P.SPN4246_TransmissionMode5_Y0; |
| 32358 | |
| 32359 | /* SystemInitialize for Outport: '<S647>/SPN4247_TransmissionMode6' */ |
| 32360 | L4_MABX_B.SFunction1_o23 = L4_MABX_P.SPN4247_TransmissionMode6_Y0; |
| 32361 | |
| 32362 | /* SystemInitialize for Outport: '<S647>/SPN4248_TransmissionMode7' */ |
| 32363 | L4_MABX_B.SFunction1_o24 = L4_MABX_P.SPN4248_TransmissionMode7_Y0; |
| 32364 | |
| 32365 | /* SystemInitialize for Outport: '<S647>/SPN4249_TransmissionMode8' */ |
| 32366 | L4_MABX_B.SFunction1_o25 = L4_MABX_P.SPN4249_TransmissionMode8_Y0; |
| 32367 | |
| 32368 | /* SystemInitialize for Outport: '<S647>/RX status' */ |
| 32369 | L4_MABX_B.SFunction1_o26 = L4_MABX_P.RXstatus_Y0_n5k; |
| 32370 | |
| 32371 | /* SystemInitialize for Outport: '<S647>/RX time' */ |
| 32372 | L4_MABX_B.SFunction1_o27 = L4_MABX_P.RXtime_Y0_pt; |
| 32373 | |
| 32374 | /* SystemInitialize for Outport: '<S647>/RX delta time' */ |
| 32375 | L4_MABX_B.SFunction1_o28 = L4_MABX_P.RXdeltatime_Y0_kp; |
| 32376 | |
| 32377 | /* End of SystemInitialize for SubSystem: '<S646>/TC1_03_05' */ |
| 32378 | |
| 32379 | /* SystemInitialize for Atomic SubSystem: '<S855>/CAN_TX_50ms' */ |
| 32380 | /* SystemInitialize for Enabled SubSystem: '<S1060>/CCVS1_E3' */ |
| 32381 | /* SystemInitialize for Outport: '<S1062>/TX status' */ |
| 32382 | L4_MABX_B.SFunction1_o1_kr = L4_MABX_P.TXstatus_Y0_l; |
| 32383 | |
| 32384 | /* SystemInitialize for Outport: '<S1062>/TX time' */ |
| 32385 | L4_MABX_B.SFunction1_o2_p = L4_MABX_P.TXtime_Y0_gj; |
| 32386 | |
| 32387 | /* SystemInitialize for Outport: '<S1062>/TX delta time' */ |
| 32388 | L4_MABX_B.SFunction1_o3_m = L4_MABX_P.TXdeltatime_Y0_go; |
| 32389 | |
| 32390 | /* SystemInitialize for Outport: '<S1062>/TX delay time' */ |
| 32391 | L4_MABX_B.SFunction1_o4_h = L4_MABX_P.TXdelaytime_Y0_et; |
| 32392 | |
| 32393 | /* End of SystemInitialize for SubSystem: '<S1060>/CCVS1_E3' */ |
| 32394 | |
| 32395 | /* SystemInitialize for Enabled SubSystem: '<S1061>/TC1_03_05' */ |
| 32396 | /* SystemInitialize for Outport: '<S1063>/TX status' */ |
| 32397 | L4_MABX_B.SFunction1_o1_a = L4_MABX_P.TXstatus_Y0_k2; |
| 32398 | |
| 32399 | /* SystemInitialize for Outport: '<S1063>/TX time' */ |
| 32400 | L4_MABX_B.SFunction1_o2_h = L4_MABX_P.TXtime_Y0_ce; |
| 32401 | |
| 32402 | /* SystemInitialize for Outport: '<S1063>/TX delta time' */ |
| 32403 | L4_MABX_B.SFunction1_o3_e = L4_MABX_P.TXdeltatime_Y0_oa; |
| 32404 | |
| 32405 | /* SystemInitialize for Outport: '<S1063>/TX delay time' */ |
| 32406 | L4_MABX_B.SFunction1_o4_f = L4_MABX_P.TXdelaytime_Y0_kz; |
| 32407 | |
| 32408 | /* End of SystemInitialize for SubSystem: '<S1061>/TC1_03_05' */ |
| 32409 | /* End of SystemInitialize for SubSystem: '<S855>/CAN_TX_50ms' */ |
| 32410 | |
| 32411 | /* SystemInitialize for Enabled SubSystem: '<S644>/SystemTime_01' */ |
| 32412 | /* SystemInitialize for Outport: '<S645>/SID' */ |
| 32413 | L4_MABX_B.SFunction1_o1_os = L4_MABX_P.SID_Y0_b; |
| 32414 | |
| 32415 | /* SystemInitialize for Outport: '<S645>/Source' */ |
| 32416 | L4_MABX_B.SFunction1_o2_ly = L4_MABX_P.Source_Y0; |
| 32417 | |
| 32418 | /* SystemInitialize for Outport: '<S645>/Date' */ |
| 32419 | L4_MABX_B.SFunction1_o3_g = L4_MABX_P.Date_Y0; |
| 32420 | |
| 32421 | /* SystemInitialize for Outport: '<S645>/Time' */ |
| 32422 | L4_MABX_B.SFunction1_o4_hf = L4_MABX_P.Time_Y0; |
| 32423 | |
| 32424 | /* SystemInitialize for Outport: '<S645>/RX status' */ |
| 32425 | L4_MABX_B.SFunction1_o5_g = L4_MABX_P.RXstatus_Y0_e2; |
| 32426 | |
| 32427 | /* SystemInitialize for Outport: '<S645>/RX time' */ |
| 32428 | L4_MABX_B.SFunction1_o6_k = L4_MABX_P.RXtime_Y0_dm; |
| 32429 | |
| 32430 | /* SystemInitialize for Outport: '<S645>/RX delta time' */ |
| 32431 | L4_MABX_B.SFunction1_o7_e = L4_MABX_P.RXdeltatime_Y0_fb; |
| 32432 | |
| 32433 | /* End of SystemInitialize for SubSystem: '<S644>/SystemTime_01' */ |
| 32434 | |
| 32435 | /* SystemInitialize for Enabled SubSystem: '<S1073>/Std_SystemTime_01' */ |
| 32436 | /* SystemInitialize for Outport: '<S1075>/TX status' */ |
| 32437 | L4_MABX_B.SFunction1_o1_l = L4_MABX_P.TXstatus_Y0_dc; |
| 32438 | |
| 32439 | /* SystemInitialize for Outport: '<S1075>/TX time' */ |
| 32440 | L4_MABX_B.SFunction1_o2_d = L4_MABX_P.TXtime_Y0_mc; |
| 32441 | |
| 32442 | /* SystemInitialize for Outport: '<S1075>/TX delta time' */ |
| 32443 | L4_MABX_B.SFunction1_o3 = L4_MABX_P.TXdeltatime_Y0_ny; |
| 32444 | |
| 32445 | /* SystemInitialize for Outport: '<S1075>/TX delay time' */ |
| 32446 | L4_MABX_B.SFunction1_o4 = L4_MABX_P.TXdelaytime_Y0_hu; |
| 32447 | |
| 32448 | /* End of SystemInitialize for SubSystem: '<S1073>/Std_SystemTime_01' */ |
| 32449 | |
| 32450 | /* SystemInitialize for Triggered SubSystem: '<S1068>/CAN_TYPE1_TX_M1_C1' */ |
| 32451 | /* SystemInitialize for Outport: '<S1070>/TX status' */ |
| 32452 | L4_MABX_B.SFunction1_o1_o = L4_MABX_P.TXstatus_Y0_ih; |
| 32453 | |
| 32454 | /* SystemInitialize for Outport: '<S1070>/TX time' */ |
| 32455 | L4_MABX_B.SFunction1_o2_a = L4_MABX_P.TXtime_Y0_ix; |
| 32456 | |
| 32457 | /* SystemInitialize for Outport: '<S1070>/TX delta time' */ |
| 32458 | L4_MABX_B.SFunction1_o3_c = L4_MABX_P.TXdeltatime_Y0_iw; |
| 32459 | |
| 32460 | /* SystemInitialize for Outport: '<S1070>/TX delay time' */ |
| 32461 | L4_MABX_B.SFunction1_o4_l = L4_MABX_P.TXdelaytime_Y0_o; |
| 32462 | |
| 32463 | /* End of SystemInitialize for SubSystem: '<S1068>/CAN_TYPE1_TX_M1_C1' */ |
| 32464 | |
| 32465 | /* SystemInitialize for Triggered SubSystem: '<S1069>/CAN_TYPE1_TX_M1_C1' */ |
| 32466 | /* SystemInitialize for Outport: '<S1071>/TX status' */ |
| 32467 | L4_MABX_B.SFunction1_o1_j = L4_MABX_P.TXstatus_Y0_eu3; |
| 32468 | |
| 32469 | /* SystemInitialize for Outport: '<S1071>/TX time' */ |
| 32470 | L4_MABX_B.SFunction1_o2_e = L4_MABX_P.TXtime_Y0_n; |
| 32471 | |
| 32472 | /* SystemInitialize for Outport: '<S1071>/TX delta time' */ |
| 32473 | L4_MABX_B.SFunction1_o3_l = L4_MABX_P.TXdeltatime_Y0_e1; |
| 32474 | |
| 32475 | /* SystemInitialize for Outport: '<S1071>/TX delay time' */ |
| 32476 | L4_MABX_B.SFunction1_o4_a = L4_MABX_P.TXdelaytime_Y0_p1; |
| 32477 | |
| 32478 | /* End of SystemInitialize for SubSystem: '<S1069>/CAN_TYPE1_TX_M1_C1' */ |
| 32479 | |
| 32480 | /* SystemInitialize for Chart: '<S865>/Chart' */ |
| 32481 | L4_MABX_DW.temporalCounter_i1_m = 0U; |
| 32482 | L4_MABX_DW.is_active_c4_SUB_ECU_L4_MABX_HW = 0U; |
| 32483 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 32484 | |
| 32485 | /* SystemInitialize for Enabled SubSystem: '<S579>/GNSSDOPs_011' */ |
| 32486 | /* SystemInitialize for Outport: '<S580>/SID' */ |
| 32487 | L4_MABX_B.SFunction1_o1_hs = L4_MABX_P.SID_Y0_l; |
| 32488 | |
| 32489 | /* SystemInitialize for Outport: '<S580>/SetMode' */ |
| 32490 | L4_MABX_B.SFunction1_o2_d0 = L4_MABX_P.SetMode_Y0; |
| 32491 | |
| 32492 | /* SystemInitialize for Outport: '<S580>/OpMode' */ |
| 32493 | L4_MABX_B.SFunction1_o3_o4 = L4_MABX_P.OpMode_Y0; |
| 32494 | |
| 32495 | /* SystemInitialize for Outport: '<S580>/HDOP_' */ |
| 32496 | L4_MABX_B.SFunction1_o4_j0 = L4_MABX_P.HDOP_Y0; |
| 32497 | |
| 32498 | /* SystemInitialize for Outport: '<S580>/VDOP' */ |
| 32499 | L4_MABX_B.SFunction1_o5_nf = L4_MABX_P.VDOP_Y0; |
| 32500 | |
| 32501 | /* SystemInitialize for Outport: '<S580>/TDOP' */ |
| 32502 | L4_MABX_B.SFunction1_o6_g4y = L4_MABX_P.TDOP_Y0; |
| 32503 | |
| 32504 | /* SystemInitialize for Outport: '<S580>/RX status' */ |
| 32505 | L4_MABX_B.SFunction1_o7_l3 = L4_MABX_P.RXstatus_Y0_j; |
| 32506 | |
| 32507 | /* SystemInitialize for Outport: '<S580>/RX time' */ |
| 32508 | L4_MABX_B.SFunction1_o8_es = L4_MABX_P.RXtime_Y0_c; |
| 32509 | |
| 32510 | /* SystemInitialize for Outport: '<S580>/RX delta time' */ |
| 32511 | L4_MABX_B.SFunction1_o9_gd = L4_MABX_P.RXdeltatime_Y0_f; |
| 32512 | |
| 32513 | /* End of SystemInitialize for SubSystem: '<S579>/GNSSDOPs_011' */ |
| 32514 | |
| 32515 | /* SystemInitialize for Enabled SubSystem: '<S579>/GNSSDOPs_1' */ |
| 32516 | /* SystemInitialize for Outport: '<S581>/SID' */ |
| 32517 | L4_MABX_B.SFunction1_o1_lx = L4_MABX_P.SID_Y0_k; |
| 32518 | |
| 32519 | /* SystemInitialize for Outport: '<S581>/SetMode' */ |
| 32520 | L4_MABX_B.SFunction1_o2_ad5 = L4_MABX_P.SetMode_Y0_l; |
| 32521 | |
| 32522 | /* SystemInitialize for Outport: '<S581>/OpMode' */ |
| 32523 | L4_MABX_B.SFunction1_o3_g5 = L4_MABX_P.OpMode_Y0_e; |
| 32524 | |
| 32525 | /* SystemInitialize for Outport: '<S581>/HDOP_' */ |
| 32526 | L4_MABX_B.SFunction1_o4_iv = L4_MABX_P.HDOP_Y0_a; |
| 32527 | |
| 32528 | /* SystemInitialize for Outport: '<S581>/VDOP' */ |
| 32529 | L4_MABX_B.SFunction1_o5_lw = L4_MABX_P.VDOP_Y0_d; |
| 32530 | |
| 32531 | /* SystemInitialize for Outport: '<S581>/TDOP' */ |
| 32532 | L4_MABX_B.SFunction1_o6_nk = L4_MABX_P.TDOP_Y0_e; |
| 32533 | |
| 32534 | /* SystemInitialize for Outport: '<S581>/RX status' */ |
| 32535 | L4_MABX_B.SFunction1_o7_ev = L4_MABX_P.RXstatus_Y0_lq; |
| 32536 | |
| 32537 | /* SystemInitialize for Outport: '<S581>/RX time' */ |
| 32538 | L4_MABX_B.SFunction1_o8_lx = L4_MABX_P.RXtime_Y0_g; |
| 32539 | |
| 32540 | /* SystemInitialize for Outport: '<S581>/RX delta time' */ |
| 32541 | L4_MABX_B.SFunction1_o9_d = L4_MABX_P.RXdeltatime_Y0_i; |
| 32542 | |
| 32543 | /* End of SystemInitialize for SubSystem: '<S579>/GNSSDOPs_1' */ |
| 32544 | |
| 32545 | /* SystemInitialize for Atomic SubSystem: '<S65>/Task_20ms' */ |
| 32546 | /* InitializeConditions for UnitDelay: '<S401>/Unit Delay1' */ |
| 32547 | L4_MABX_DW.UnitDelay1_DSTATE = L4_MABX_P.UnitDelay1_InitialCondition_p; |
| 32548 | |
| 32549 | /* InitializeConditions for DiscreteIntegrator: '<S402>/LongitudnalPosition' */ |
| 32550 | L4_MABX_DW.LongitudnalPosition_DSTATE = L4_MABX_B.InitialPosition; |
| 32551 | L4_MABX_DW.LongitudnalPosition_PrevResetSt = 2; |
| 32552 | |
| 32553 | /* InitializeConditions for DiscreteIntegrator: '<S402>/VehHeading' */ |
| 32554 | L4_MABX_DW.VehHeading_DSTATE = L4_MABX_B.InitialHeading; |
| 32555 | L4_MABX_DW.VehHeading_PrevResetState = 2; |
| 32556 | |
| 32557 | /* InitializeConditions for DiscreteIntegrator: '<S402>/XPosition' */ |
| 32558 | L4_MABX_DW.XPosition_DSTATE = L4_MABX_B.InitialXPosition; |
| 32559 | L4_MABX_DW.XPosition_PrevResetState = 2; |
| 32560 | |
| 32561 | /* InitializeConditions for DiscreteIntegrator: '<S402>/YPosition' */ |
| 32562 | L4_MABX_DW.YPosition_DSTATE = L4_MABX_B.InitialYPosition; |
| 32563 | L4_MABX_DW.YPosition_PrevResetState = 2; |
| 32564 | |
| 32565 | /* End of SystemInitialize for SubSystem: '<S65>/Task_20ms' */ |
| 32566 | |
| 32567 | /* SystemInitialize for S-Function (rti_commonblock): '<S414>/S-Function1' incorporates: |
| 32568 | * SubSystem: '<S405>/Background_Task' |
| 32569 | */ |
| 32570 | L4_MAB_Background_Task_Init(); |
| 32571 | |
| 32572 | /* End of SystemInitialize for S-Function (rti_commonblock): '<S414>/S-Function1' */ |
| 32573 | |
| 32574 | /* SystemInitialize for S-Function (rti_commonblock): '<S420>/S-Function1' incorporates: |
| 32575 | * SubSystem: '<S405>/Interrupt_Task' |
| 32576 | */ |
| 32577 | L4_MABX_Interrupt_Task_Init(); |
| 32578 | |
| 32579 | /* End of SystemInitialize for S-Function (rti_commonblock): '<S420>/S-Function1' */ |
| 32580 | |
| 32581 | /* SystemInitialize for Enabled SubSystem: '<S501>/AEBS1_A0' */ |
| 32582 | /* SystemInitialize for Outport: '<S502>/AdvEmergencyBrkSysState' */ |
| 32583 | L4_MABX_B.SFunction1_o1_jc = L4_MABX_P.AdvEmergencyBrkSysState_Y0; |
| 32584 | |
| 32585 | /* SystemInitialize for Outport: '<S502>/CollisionWarningLevel' */ |
| 32586 | L4_MABX_B.SFunction1_o2_pw = L4_MABX_P.CollisionWarningLevel_Y0; |
| 32587 | |
| 32588 | /* SystemInitialize for Outport: '<S502>/RelObjctDetForAdvEmergBrakingSys' */ |
| 32589 | L4_MABX_B.SFunction1_o3_km = L4_MABX_P.RelObjctDetForAdvEmergBrakingSy; |
| 32590 | |
| 32591 | /* SystemInitialize for Outport: '<S502>/BendOffProbabOfRelevantObject' */ |
| 32592 | L4_MABX_B.SFunction1_o4_ke = L4_MABX_P.BendOffProbabOfRelevantObject_Y; |
| 32593 | |
| 32594 | /* SystemInitialize for Outport: '<S502>/TimeToCollisionWithRelevantObj' */ |
| 32595 | L4_MABX_B.SFunction1_o5_pv = L4_MABX_P.TimeToCollisionWithRelevantObj_; |
| 32596 | |
| 32597 | /* SystemInitialize for Outport: '<S502>/RX status' */ |
| 32598 | L4_MABX_B.SFunction1_o6_pv = L4_MABX_P.RXstatus_Y0_i; |
| 32599 | |
| 32600 | /* SystemInitialize for Outport: '<S502>/RX time' */ |
| 32601 | L4_MABX_B.SFunction1_o7_jm = L4_MABX_P.RXtime_Y0_n5; |
| 32602 | |
| 32603 | /* SystemInitialize for Outport: '<S502>/RX delta time' */ |
| 32604 | L4_MABX_B.SFunction1_o8_cl = L4_MABX_P.RXdeltatime_Y0_b; |
| 32605 | |
| 32606 | /* End of SystemInitialize for SubSystem: '<S501>/AEBS1_A0' */ |
| 32607 | |
| 32608 | /* SystemInitialize for Enabled SubSystem: '<S507>/B2' */ |
| 32609 | /* SystemInitialize for Outport: '<S508>/BrakeAppPressDemanded' */ |
| 32610 | L4_MABX_B.SFunction1_o1_pc = L4_MABX_P.BrakeAppPressDemanded_Y0; |
| 32611 | |
| 32612 | /* SystemInitialize for Outport: '<S508>/BrakeSwitch2' */ |
| 32613 | L4_MABX_B.SFunction1_o2_bz = L4_MABX_P.BrakeSwitch2_Y0; |
| 32614 | |
| 32615 | /* SystemInitialize for Outport: '<S508>/RX status' */ |
| 32616 | L4_MABX_B.SFunction1_o3_o1 = L4_MABX_P.RXstatus_Y0_b; |
| 32617 | |
| 32618 | /* SystemInitialize for Outport: '<S508>/RX time' */ |
| 32619 | L4_MABX_B.SFunction1_o4_md = L4_MABX_P.RXtime_Y0_f; |
| 32620 | |
| 32621 | /* SystemInitialize for Outport: '<S508>/RX delta time' */ |
| 32622 | L4_MABX_B.SFunction1_o5_lj = L4_MABX_P.RXdeltatime_Y0_o; |
| 32623 | |
| 32624 | /* End of SystemInitialize for SubSystem: '<S507>/B2' */ |
| 32625 | |
| 32626 | /* SystemInitialize for Enabled SubSystem: '<S509>/Tracks' */ |
| 32627 | /* SystemInitialize for Outport: '<S510>/tr0_track_selection_status' */ |
| 32628 | L4_MABX_B.SFunction1_o1_ly = L4_MABX_P.tr0_track_selection_status_Y0; |
| 32629 | |
| 32630 | /* SystemInitialize for Outport: '<S510>/tr0_corrected_lateral_distance' */ |
| 32631 | L4_MABX_B.SFunction1_o2_fl = L4_MABX_P.tr0_corrected_lateral_distance_; |
| 32632 | |
| 32633 | /* SystemInitialize for Outport: '<S510>/tr1_track_selection_status' */ |
| 32634 | L4_MABX_B.SFunction1_o3_os = L4_MABX_P.tr1_track_selection_status_Y0; |
| 32635 | |
| 32636 | /* SystemInitialize for Outport: '<S510>/tr1_corrected_lateral_distance' */ |
| 32637 | L4_MABX_B.SFunction1_o4_dz = L4_MABX_P.tr1_corrected_lateral_distance_; |
| 32638 | |
| 32639 | /* SystemInitialize for Outport: '<S510>/tr2_track_selection_status' */ |
| 32640 | L4_MABX_B.SFunction1_o5_pr = L4_MABX_P.tr2_track_selection_status_Y0; |
| 32641 | |
| 32642 | /* SystemInitialize for Outport: '<S510>/tr2_corrected_lateral_distance' */ |
| 32643 | L4_MABX_B.SFunction1_o6_hf = L4_MABX_P.tr2_corrected_lateral_distance_; |
| 32644 | |
| 32645 | /* SystemInitialize for Outport: '<S510>/tr3_track_selection_status' */ |
| 32646 | L4_MABX_B.SFunction1_o7_pz = L4_MABX_P.tr3_track_selection_status_Y0; |
| 32647 | |
| 32648 | /* SystemInitialize for Outport: '<S510>/tr3_corrected_lateral_distance' */ |
| 32649 | L4_MABX_B.SFunction1_o8_g = L4_MABX_P.tr3_corrected_lateral_distance_; |
| 32650 | |
| 32651 | /* SystemInitialize for Outport: '<S510>/tr4_track_selection_status' */ |
| 32652 | L4_MABX_B.SFunction1_o9_g5 = L4_MABX_P.tr4_track_selection_status_Y0; |
| 32653 | |
| 32654 | /* SystemInitialize for Outport: '<S510>/tr4_corrected_lateral_distance' */ |
| 32655 | L4_MABX_B.SFunction1_o10_d5 = L4_MABX_P.tr4_corrected_lateral_distance_; |
| 32656 | |
| 32657 | /* SystemInitialize for Outport: '<S510>/tr5_track_selection_status' */ |
| 32658 | L4_MABX_B.SFunction1_o11_by = L4_MABX_P.tr5_track_selection_status_Y0; |
| 32659 | |
| 32660 | /* SystemInitialize for Outport: '<S510>/tr5_corrected_lateral_distance' */ |
| 32661 | L4_MABX_B.SFunction1_o12_b = L4_MABX_P.tr5_corrected_lateral_distance_; |
| 32662 | |
| 32663 | /* SystemInitialize for Outport: '<S510>/tr6_track_selection_status' */ |
| 32664 | L4_MABX_B.SFunction1_o13_g0 = L4_MABX_P.tr6_track_selection_status_Y0; |
| 32665 | |
| 32666 | /* SystemInitialize for Outport: '<S510>/tr6_corrected_lateral_distance' */ |
| 32667 | L4_MABX_B.SFunction1_o14_nc = L4_MABX_P.tr6_corrected_lateral_distance_; |
| 32668 | |
| 32669 | /* SystemInitialize for Outport: '<S510>/tr7_track_selection_status' */ |
| 32670 | L4_MABX_B.SFunction1_o15_ag = L4_MABX_P.tr7_track_selection_status_Y0; |
| 32671 | |
| 32672 | /* SystemInitialize for Outport: '<S510>/tr7_corrected_lateral_distance' */ |
| 32673 | L4_MABX_B.SFunction1_o16_c = L4_MABX_P.tr7_corrected_lateral_distance_; |
| 32674 | |
| 32675 | /* SystemInitialize for Outport: '<S510>/tr8_track_selection_status' */ |
| 32676 | L4_MABX_B.SFunction1_o17_b = L4_MABX_P.tr8_track_selection_status_Y0; |
| 32677 | |
| 32678 | /* SystemInitialize for Outport: '<S510>/tr8_corrected_lateral_distance' */ |
| 32679 | L4_MABX_B.SFunction1_o18_b = L4_MABX_P.tr8_corrected_lateral_distance_; |
| 32680 | |
| 32681 | /* SystemInitialize for Outport: '<S510>/tr9_track_selection_status' */ |
| 32682 | L4_MABX_B.SFunction1_o19_n = L4_MABX_P.tr9_track_selection_status_Y0; |
| 32683 | |
| 32684 | /* SystemInitialize for Outport: '<S510>/tr9_corrected_lateral_distance' */ |
| 32685 | L4_MABX_B.SFunction1_o20_j = L4_MABX_P.tr9_corrected_lateral_distance_; |
| 32686 | |
| 32687 | /* SystemInitialize for Outport: '<S510>/tr0_lateral_position' */ |
| 32688 | L4_MABX_B.SFunction1_o21_e5 = L4_MABX_P.tr0_lateral_position_Y0; |
| 32689 | |
| 32690 | /* SystemInitialize for Outport: '<S510>/tr1_lateral_position' */ |
| 32691 | L4_MABX_B.SFunction1_o22_f = L4_MABX_P.tr1_lateral_position_Y0; |
| 32692 | |
| 32693 | /* SystemInitialize for Outport: '<S510>/tr2_lateral_position' */ |
| 32694 | L4_MABX_B.SFunction1_o23_e = L4_MABX_P.tr2_lateral_position_Y0; |
| 32695 | |
| 32696 | /* SystemInitialize for Outport: '<S510>/tr3_lateral_position' */ |
| 32697 | L4_MABX_B.SFunction1_o24_g = L4_MABX_P.tr3_lateral_position_Y0; |
| 32698 | |
| 32699 | /* SystemInitialize for Outport: '<S510>/tr4_lateral_position' */ |
| 32700 | L4_MABX_B.SFunction1_o25_b = L4_MABX_P.tr4_lateral_position_Y0; |
| 32701 | |
| 32702 | /* SystemInitialize for Outport: '<S510>/tr5_lateral_position' */ |
| 32703 | L4_MABX_B.SFunction1_o26_l = L4_MABX_P.tr5_lateral_position_Y0; |
| 32704 | |
| 32705 | /* SystemInitialize for Outport: '<S510>/tr6_lateral_position' */ |
| 32706 | L4_MABX_B.SFunction1_o27_h = L4_MABX_P.tr6_lateral_position_Y0; |
| 32707 | |
| 32708 | /* SystemInitialize for Outport: '<S510>/tr7_lateral_position' */ |
| 32709 | L4_MABX_B.SFunction1_o28_f = L4_MABX_P.tr7_lateral_position_Y0; |
| 32710 | |
| 32711 | /* SystemInitialize for Outport: '<S510>/tr8_lateral_position' */ |
| 32712 | L4_MABX_B.SFunction1_o29 = L4_MABX_P.tr8_lateral_position_Y0; |
| 32713 | |
| 32714 | /* SystemInitialize for Outport: '<S510>/tr9_lateral_position' */ |
| 32715 | L4_MABX_B.SFunction1_o30 = L4_MABX_P.tr9_lateral_position_Y0; |
| 32716 | |
| 32717 | /* SystemInitialize for Outport: '<S510>/tr0_range' */ |
| 32718 | L4_MABX_B.SFunction1_o31 = L4_MABX_P.tr0_range_Y0; |
| 32719 | |
| 32720 | /* SystemInitialize for Outport: '<S510>/tr1_range' */ |
| 32721 | L4_MABX_B.SFunction1_o32 = L4_MABX_P.tr1_range_Y0; |
| 32722 | |
| 32723 | /* SystemInitialize for Outport: '<S510>/tr2_range' */ |
| 32724 | L4_MABX_B.SFunction1_o33 = L4_MABX_P.tr2_range_Y0; |
| 32725 | |
| 32726 | /* SystemInitialize for Outport: '<S510>/tr3_range' */ |
| 32727 | L4_MABX_B.SFunction1_o34 = L4_MABX_P.tr3_range_Y0; |
| 32728 | |
| 32729 | /* SystemInitialize for Outport: '<S510>/tr4_range' */ |
| 32730 | L4_MABX_B.SFunction1_o35 = L4_MABX_P.tr4_range_Y0; |
| 32731 | |
| 32732 | /* SystemInitialize for Outport: '<S510>/tr5_range' */ |
| 32733 | L4_MABX_B.SFunction1_o36 = L4_MABX_P.tr5_range_Y0; |
| 32734 | |
| 32735 | /* SystemInitialize for Outport: '<S510>/tr6_range' */ |
| 32736 | L4_MABX_B.SFunction1_o37 = L4_MABX_P.tr6_range_Y0; |
| 32737 | |
| 32738 | /* SystemInitialize for Outport: '<S510>/tr7_range' */ |
| 32739 | L4_MABX_B.SFunction1_o38 = L4_MABX_P.tr7_range_Y0; |
| 32740 | |
| 32741 | /* SystemInitialize for Outport: '<S510>/tr8_range' */ |
| 32742 | L4_MABX_B.SFunction1_o39 = L4_MABX_P.tr8_range_Y0; |
| 32743 | |
| 32744 | /* SystemInitialize for Outport: '<S510>/tr9_range' */ |
| 32745 | L4_MABX_B.SFunction1_o40 = L4_MABX_P.tr9_range_Y0; |
| 32746 | |
| 32747 | /* SystemInitialize for Outport: '<S510>/tr0_radar_confidence' */ |
| 32748 | L4_MABX_B.SFunction1_o41 = L4_MABX_P.tr0_radar_confidence_Y0; |
| 32749 | |
| 32750 | /* SystemInitialize for Outport: '<S510>/tr1_radar_confidence' */ |
| 32751 | L4_MABX_B.SFunction1_o42 = L4_MABX_P.tr1_radar_confidence_Y0; |
| 32752 | |
| 32753 | /* SystemInitialize for Outport: '<S510>/tr2_radar_confidence' */ |
| 32754 | L4_MABX_B.SFunction1_o43 = L4_MABX_P.tr2_radar_confidence_Y0; |
| 32755 | |
| 32756 | /* SystemInitialize for Outport: '<S510>/tr3_radar_confidence' */ |
| 32757 | L4_MABX_B.SFunction1_o44 = L4_MABX_P.tr3_radar_confidence_Y0; |
| 32758 | |
| 32759 | /* SystemInitialize for Outport: '<S510>/tr4_radar_confidence' */ |
| 32760 | L4_MABX_B.SFunction1_o45 = L4_MABX_P.tr4_radar_confidence_Y0; |
| 32761 | |
| 32762 | /* SystemInitialize for Outport: '<S510>/tr5_radar_confidence' */ |
| 32763 | L4_MABX_B.SFunction1_o46 = L4_MABX_P.tr5_radar_confidence_Y0; |
| 32764 | |
| 32765 | /* SystemInitialize for Outport: '<S510>/tr6_radar_confidence' */ |
| 32766 | L4_MABX_B.SFunction1_o47 = L4_MABX_P.tr6_radar_confidence_Y0; |
| 32767 | |
| 32768 | /* SystemInitialize for Outport: '<S510>/tr7_radar_confidence' */ |
| 32769 | L4_MABX_B.SFunction1_o48 = L4_MABX_P.tr7_radar_confidence_Y0; |
| 32770 | |
| 32771 | /* SystemInitialize for Outport: '<S510>/tr8_radar_confidence' */ |
| 32772 | L4_MABX_B.SFunction1_o49 = L4_MABX_P.tr8_radar_confidence_Y0; |
| 32773 | |
| 32774 | /* SystemInitialize for Outport: '<S510>/tr9_radar_confidence' */ |
| 32775 | L4_MABX_B.SFunction1_o50 = L4_MABX_P.tr9_radar_confidence_Y0; |
| 32776 | |
| 32777 | /* SystemInitialize for Outport: '<S510>/tr0_relative_velocitiy' */ |
| 32778 | L4_MABX_B.SFunction1_o51 = L4_MABX_P.tr0_relative_velocitiy_Y0; |
| 32779 | |
| 32780 | /* SystemInitialize for Outport: '<S510>/tr0_acceleration_over_ground' */ |
| 32781 | L4_MABX_B.SFunction1_o52 = L4_MABX_P.tr0_acceleration_over_ground_Y0; |
| 32782 | |
| 32783 | /* SystemInitialize for Outport: '<S510>/tr1_relative_velocitiy' */ |
| 32784 | L4_MABX_B.SFunction1_o53 = L4_MABX_P.tr1_relative_velocitiy_Y0; |
| 32785 | |
| 32786 | /* SystemInitialize for Outport: '<S510>/tr1_acceleration_over_ground' */ |
| 32787 | L4_MABX_B.SFunction1_o54 = L4_MABX_P.tr1_acceleration_over_ground_Y0; |
| 32788 | |
| 32789 | /* SystemInitialize for Outport: '<S510>/tr2_relative_velocitiy' */ |
| 32790 | L4_MABX_B.SFunction1_o55 = L4_MABX_P.tr2_relative_velocitiy_Y0; |
| 32791 | |
| 32792 | /* SystemInitialize for Outport: '<S510>/tr2_acceleration_over_ground' */ |
| 32793 | L4_MABX_B.SFunction1_o56 = L4_MABX_P.tr2_acceleration_over_ground_Y0; |
| 32794 | |
| 32795 | /* SystemInitialize for Outport: '<S510>/tr3_relative_velocitiy' */ |
| 32796 | L4_MABX_B.SFunction1_o57 = L4_MABX_P.tr3_relative_velocitiy_Y0; |
| 32797 | |
| 32798 | /* SystemInitialize for Outport: '<S510>/tr3_acceleration_over_ground' */ |
| 32799 | L4_MABX_B.SFunction1_o58 = L4_MABX_P.tr3_acceleration_over_ground_Y0; |
| 32800 | |
| 32801 | /* SystemInitialize for Outport: '<S510>/tr4_relative_velocitiy' */ |
| 32802 | L4_MABX_B.SFunction1_o59 = L4_MABX_P.tr4_relative_velocitiy_Y0; |
| 32803 | |
| 32804 | /* SystemInitialize for Outport: '<S510>/tr4_acceleration_over_ground' */ |
| 32805 | L4_MABX_B.SFunction1_o60 = L4_MABX_P.tr4_acceleration_over_ground_Y0; |
| 32806 | |
| 32807 | /* SystemInitialize for Outport: '<S510>/tr5_relative_velocitiy' */ |
| 32808 | L4_MABX_B.SFunction1_o61 = L4_MABX_P.tr5_relative_velocitiy_Y0; |
| 32809 | |
| 32810 | /* SystemInitialize for Outport: '<S510>/tr5_acceleration_over_ground' */ |
| 32811 | L4_MABX_B.SFunction1_o62 = L4_MABX_P.tr5_acceleration_over_ground_Y0; |
| 32812 | |
| 32813 | /* SystemInitialize for Outport: '<S510>/tr6_relative_velocitiy' */ |
| 32814 | L4_MABX_B.SFunction1_o63 = L4_MABX_P.tr6_relative_velocitiy_Y0; |
| 32815 | |
| 32816 | /* SystemInitialize for Outport: '<S510>/tr6_acceleration_over_ground' */ |
| 32817 | L4_MABX_B.SFunction1_o64 = L4_MABX_P.tr6_acceleration_over_ground_Y0; |
| 32818 | |
| 32819 | /* SystemInitialize for Outport: '<S510>/tr7_relative_velocitiy' */ |
| 32820 | L4_MABX_B.SFunction1_o65 = L4_MABX_P.tr7_relative_velocitiy_Y0; |
| 32821 | |
| 32822 | /* SystemInitialize for Outport: '<S510>/tr7_acceleration_over_ground' */ |
| 32823 | L4_MABX_B.SFunction1_o66 = L4_MABX_P.tr7_acceleration_over_ground_Y0; |
| 32824 | |
| 32825 | /* SystemInitialize for Outport: '<S510>/tr8_relative_velocitiy' */ |
| 32826 | L4_MABX_B.SFunction1_o67 = L4_MABX_P.tr8_relative_velocitiy_Y0; |
| 32827 | |
| 32828 | /* SystemInitialize for Outport: '<S510>/tr8_acceleration_over_ground' */ |
| 32829 | L4_MABX_B.SFunction1_o68 = L4_MABX_P.tr8_acceleration_over_ground_Y0; |
| 32830 | |
| 32831 | /* SystemInitialize for Outport: '<S510>/tr9_relative_velocitiy' */ |
| 32832 | L4_MABX_B.SFunction1_o69 = L4_MABX_P.tr9_relative_velocitiy_Y0; |
| 32833 | |
| 32834 | /* SystemInitialize for Outport: '<S510>/tr9_acceleration_over_ground' */ |
| 32835 | L4_MABX_B.SFunction1_o70 = L4_MABX_P.tr9_acceleration_over_ground_Y0; |
| 32836 | |
| 32837 | /* SystemInitialize for Outport: '<S510>/track_multiplexor' */ |
| 32838 | L4_MABX_B.SFunction1_o71 = L4_MABX_P.track_multiplexor_Y0; |
| 32839 | |
| 32840 | /* SystemInitialize for Outport: '<S510>/RX status' */ |
| 32841 | L4_MABX_B.SFunction1_o72 = L4_MABX_P.RXstatus_Y0_m; |
| 32842 | |
| 32843 | /* SystemInitialize for Outport: '<S510>/RX time' */ |
| 32844 | L4_MABX_B.SFunction1_o73 = L4_MABX_P.RXtime_Y0_ft; |
| 32845 | |
| 32846 | /* SystemInitialize for Outport: '<S510>/RX delta time' */ |
| 32847 | L4_MABX_B.SFunction1_o74 = L4_MABX_P.RXdeltatime_Y0_ew; |
| 32848 | |
| 32849 | /* End of SystemInitialize for SubSystem: '<S509>/Tracks' */ |
| 32850 | |
| 32851 | /* SystemInitialize for Enabled SubSystem: '<S520>/EBC1_0B' */ |
| 32852 | /* SystemInitialize for Outport: '<S521>/ASREngCtrlActive' */ |
| 32853 | L4_MABX_B.SFunction1_o1_bq = L4_MABX_P.ASREngCtrlActive_Y0; |
| 32854 | |
| 32855 | /* SystemInitialize for Outport: '<S521>/ASRBrakeCtrlActive' */ |
| 32856 | L4_MABX_B.SFunction1_o2_pl3 = L4_MABX_P.ASRBrakeCtrlActive_Y0; |
| 32857 | |
| 32858 | /* SystemInitialize for Outport: '<S521>/AntiLockBrakingActive' */ |
| 32859 | L4_MABX_B.SFunction1_o3_bzd = L4_MABX_P.AntiLockBrakingActive_Y0; |
| 32860 | |
| 32861 | /* SystemInitialize for Outport: '<S521>/EBSBrakeSwitch' */ |
| 32862 | L4_MABX_B.SFunction1_o4_cj = L4_MABX_P.EBSBrakeSwitch_Y0; |
| 32863 | |
| 32864 | /* SystemInitialize for Outport: '<S521>/BrakePedalPos' */ |
| 32865 | L4_MABX_B.SFunction1_o5_a = L4_MABX_P.BrakePedalPos_Y0; |
| 32866 | |
| 32867 | /* SystemInitialize for Outport: '<S521>/ABSOffroadSwitch' */ |
| 32868 | L4_MABX_B.SFunction1_o6_nt = L4_MABX_P.ABSOffroadSwitch_Y0; |
| 32869 | |
| 32870 | /* SystemInitialize for Outport: '<S521>/ASROffroadSwitch' */ |
| 32871 | L4_MABX_B.SFunction1_o7_lm = L4_MABX_P.ASROffroadSwitch_Y0; |
| 32872 | |
| 32873 | /* SystemInitialize for Outport: '<S521>/ASRHillHolderSwitch' */ |
| 32874 | L4_MABX_B.SFunction1_o8_n5 = L4_MABX_P.ASRHillHolderSwitch_Y0; |
| 32875 | |
| 32876 | /* SystemInitialize for Outport: '<S521>/TractionCtrlOverrideSwitch' */ |
| 32877 | L4_MABX_B.SFunction1_o9_dw = L4_MABX_P.TractionCtrlOverrideSwitch_Y0; |
| 32878 | |
| 32879 | /* SystemInitialize for Outport: '<S521>/AccelInterlockSwitch' */ |
| 32880 | L4_MABX_B.SFunction1_o10_by = L4_MABX_P.AccelInterlockSwitch_Y0; |
| 32881 | |
| 32882 | /* SystemInitialize for Outport: '<S521>/EngDerateSwitch' */ |
| 32883 | L4_MABX_B.SFunction1_o11_m = L4_MABX_P.EngDerateSwitch_Y0; |
| 32884 | |
| 32885 | /* SystemInitialize for Outport: '<S521>/EngAuxShutdownSwitch' */ |
| 32886 | L4_MABX_B.SFunction1_o12_l = L4_MABX_P.EngAuxShutdownSwitch_Y0; |
| 32887 | |
| 32888 | /* SystemInitialize for Outport: '<S521>/RemoteAccelEnableSwitch' */ |
| 32889 | L4_MABX_B.SFunction1_o13_d = L4_MABX_P.RemoteAccelEnableSwitch_Y0; |
| 32890 | |
| 32891 | /* SystemInitialize for Outport: '<S521>/EngRetarderSelection' */ |
| 32892 | L4_MABX_B.SFunction1_o14_n = L4_MABX_P.EngRetarderSelection_Y0; |
| 32893 | |
| 32894 | /* SystemInitialize for Outport: '<S521>/ABSFullyOperational' */ |
| 32895 | L4_MABX_B.SFunction1_o15_a0 = L4_MABX_P.ABSFullyOperational_Y0; |
| 32896 | |
| 32897 | /* SystemInitialize for Outport: '<S521>/EBSRedWarningSignal' */ |
| 32898 | L4_MABX_B.SFunction1_o16_k = L4_MABX_P.EBSRedWarningSignal_Y0; |
| 32899 | |
| 32900 | /* SystemInitialize for Outport: '<S521>/ABS_EBSAmberWarningSignal' */ |
| 32901 | L4_MABX_B.SFunction1_o17_j = L4_MABX_P.ABS_EBSAmberWarningSignal_Y0; |
| 32902 | |
| 32903 | /* SystemInitialize for Outport: '<S521>/ATC_ASRInformationSignal' */ |
| 32904 | L4_MABX_B.SFunction1_o18_d = L4_MABX_P.ATC_ASRInformationSignal_Y0; |
| 32905 | |
| 32906 | /* SystemInitialize for Outport: '<S521>/SrcAddrssOfCtrllngDvcFrBrkCntrl' */ |
| 32907 | L4_MABX_B.SFunction1_o19_k = L4_MABX_P.SrcAddrssOfCtrllngDvcFrBrkCntrl; |
| 32908 | |
| 32909 | /* SystemInitialize for Outport: '<S521>/HaltBrakeSwitch' */ |
| 32910 | L4_MABX_B.SFunction1_o20_h = L4_MABX_P.HaltBrakeSwitch_Y0; |
| 32911 | |
| 32912 | /* SystemInitialize for Outport: '<S521>/TrailerABSStatus' */ |
| 32913 | L4_MABX_B.SFunction1_o21_l = L4_MABX_P.TrailerABSStatus_Y0; |
| 32914 | |
| 32915 | /* SystemInitialize for Outport: '<S521>/TrctrMntdTrilerABSWarningSignal' */ |
| 32916 | L4_MABX_B.SFunction1_o22_i = L4_MABX_P.TrctrMntdTrilerABSWarningSignal; |
| 32917 | |
| 32918 | /* SystemInitialize for Outport: '<S521>/RX status' */ |
| 32919 | L4_MABX_B.SFunction1_o23_n = L4_MABX_P.RXstatus_Y0_i2; |
| 32920 | |
| 32921 | /* SystemInitialize for Outport: '<S521>/RX time' */ |
| 32922 | L4_MABX_B.SFunction1_o24_o = L4_MABX_P.RXtime_Y0_h; |
| 32923 | |
| 32924 | /* SystemInitialize for Outport: '<S521>/RX delta time' */ |
| 32925 | L4_MABX_B.SFunction1_o25_m = L4_MABX_P.RXdeltatime_Y0_l; |
| 32926 | |
| 32927 | /* End of SystemInitialize for SubSystem: '<S520>/EBC1_0B' */ |
| 32928 | |
| 32929 | /* SystemInitialize for Enabled SubSystem: '<S573>/EEC2_001' */ |
| 32930 | /* SystemInitialize for Outport: '<S574>/SPN558_AccelPed1LowIdlSwitch' */ |
| 32931 | L4_MABX_B.SFunction1_o1_a0 = L4_MABX_P.SPN558_AccelPed1LowIdlSwitch_Y0; |
| 32932 | |
| 32933 | /* SystemInitialize for Outport: '<S574>/SPN559_AccelPedKickdownSw' */ |
| 32934 | L4_MABX_B.SFunction1_o2_m4 = L4_MABX_P.SPN559_AccelPedKickdownSw_Y0; |
| 32935 | |
| 32936 | /* SystemInitialize for Outport: '<S574>/SPN1437_RoadSpeedLimitStatus' */ |
| 32937 | L4_MABX_B.SFunction1_o3_k = L4_MABX_P.SPN1437_RoadSpeedLimitStatus_Y0; |
| 32938 | |
| 32939 | /* SystemInitialize for Outport: '<S574>/SPN2970_AccelPed2LowIdlSwitch' */ |
| 32940 | L4_MABX_B.SFunction1_o4_nu = L4_MABX_P.SPN2970_AccelPed2LowIdlSwitch_Y; |
| 32941 | |
| 32942 | /* SystemInitialize for Outport: '<S574>/SPN91_AccelPedPos1' */ |
| 32943 | L4_MABX_B.SFunction1_o5_e0 = L4_MABX_P.SPN91_AccelPedPos1_Y0; |
| 32944 | |
| 32945 | /* SystemInitialize for Outport: '<S574>/SPN92_EngPercLoadAtCurrSpd' */ |
| 32946 | L4_MABX_B.SFunction1_o6_j = L4_MABX_P.SPN92_EngPercLoadAtCurrSpd_Y0; |
| 32947 | |
| 32948 | /* SystemInitialize for Outport: '<S574>/SPN974_RemAccelPedalPosition' */ |
| 32949 | L4_MABX_B.SFunction1_o7_b = L4_MABX_P.SPN974_RemAccelPedalPosition_Y0; |
| 32950 | |
| 32951 | /* SystemInitialize for Outport: '<S574>/SPN29_AccelPedPos2' */ |
| 32952 | L4_MABX_B.SFunction1_o8_py = L4_MABX_P.SPN29_AccelPedPos2_Y0; |
| 32953 | |
| 32954 | /* SystemInitialize for Outport: '<S574>/SPN2979_VehAccelRateLimStatus' */ |
| 32955 | L4_MABX_B.SFunction1_o9_iy = L4_MABX_P.SPN2979_VehAccelRateLimStatus_Y; |
| 32956 | |
| 32957 | /* SystemInitialize for Outport: '<S574>/SPN5021_MomEngMaxPwrEnFdbk' */ |
| 32958 | L4_MABX_B.SFunction1_o10_m = L4_MABX_P.SPN5021_MomEngMaxPwrEnFdbk_Y0; |
| 32959 | |
| 32960 | /* SystemInitialize for Outport: '<S574>/SPN5399_DPFThermMgmtActive' */ |
| 32961 | L4_MABX_B.SFunction1_o11_c = L4_MABX_P.SPN5399_DPFThermMgmtActive_Y0; |
| 32962 | |
| 32963 | /* SystemInitialize for Outport: '<S574>/SPN5400_SCRThermMgmtActive' */ |
| 32964 | L4_MABX_B.SFunction1_o12_i = L4_MABX_P.SPN5400_SCRThermMgmtActive_Y0; |
| 32965 | |
| 32966 | /* SystemInitialize for Outport: '<S574>/SPN3357_ActMaxAvailEngPercTrq' */ |
| 32967 | L4_MABX_B.SFunction1_o13_gy = L4_MABX_P.SPN3357_ActMaxAvailEngPercTrq_Y; |
| 32968 | |
| 32969 | /* SystemInitialize for Outport: '<S574>/SPN5398_EstPumpingPercentTorque' */ |
| 32970 | L4_MABX_B.SFunction1_o14_g = L4_MABX_P.SPN5398_EstPumpingPercentTorque; |
| 32971 | |
| 32972 | /* SystemInitialize for Outport: '<S574>/RX status' */ |
| 32973 | L4_MABX_B.SFunction1_o15_d = L4_MABX_P.RXstatus_Y0_d; |
| 32974 | |
| 32975 | /* SystemInitialize for Outport: '<S574>/RX time' */ |
| 32976 | L4_MABX_B.SFunction1_o16_e = L4_MABX_P.RXtime_Y0_al; |
| 32977 | |
| 32978 | /* SystemInitialize for Outport: '<S574>/RX delta time' */ |
| 32979 | L4_MABX_B.SFunction1_o17_l = L4_MABX_P.RXdeltatime_Y0_h; |
| 32980 | |
| 32981 | /* End of SystemInitialize for SubSystem: '<S573>/EEC2_001' */ |
| 32982 | |
| 32983 | /* SystemInitialize for Enabled SubSystem: '<S614>/CAN_TYPE1_RX_M1_C1' */ |
| 32984 | /* SystemInitialize for Outport: '<S618>/EPBPCMInhibitStatusFeedback' */ |
| 32985 | L4_MABX_B.SFunction1_o1_nn = L4_MABX_P.EPBPCMInhibitStatusFeedback_Y0; |
| 32986 | |
| 32987 | /* SystemInitialize for Outport: '<S618>/EPBPCMManualStatusFeedback' */ |
| 32988 | L4_MABX_B.SFunction1_o2_pn = L4_MABX_P.EPBPCMManualStatusFeedback_Y0; |
| 32989 | |
| 32990 | /* SystemInitialize for Outport: '<S618>/RX status' */ |
| 32991 | L4_MABX_B.SFunction1_o3_jj = L4_MABX_P.RXstatus_Y0_e0; |
| 32992 | |
| 32993 | /* SystemInitialize for Outport: '<S618>/RX time' */ |
| 32994 | L4_MABX_B.SFunction1_o4_i = L4_MABX_P.RXtime_Y0_d5; |
| 32995 | |
| 32996 | /* SystemInitialize for Outport: '<S618>/RX delta time' */ |
| 32997 | L4_MABX_B.SFunction1_o5_k = L4_MABX_P.RXdeltatime_Y0_ee; |
| 32998 | |
| 32999 | /* End of SystemInitialize for SubSystem: '<S614>/CAN_TYPE1_RX_M1_C1' */ |
| 33000 | |
| 33001 | /* SystemInitialize for Enabled SubSystem: '<S615>/CAN_TYPE1_RX_M1_C2' */ |
| 33002 | /* SystemInitialize for Outport: '<S619>/EPBPCMInhibitStatusFeedback' */ |
| 33003 | L4_MABX_B.SFunction1_o1_lae = L4_MABX_P.EPBPCMInhibitStatusFeedback_Y_e; |
| 33004 | |
| 33005 | /* SystemInitialize for Outport: '<S619>/EPBPCMManualStatusFeedback' */ |
| 33006 | L4_MABX_B.SFunction1_o2_bh = L4_MABX_P.EPBPCMManualStatusFeedback_Y0_g; |
| 33007 | |
| 33008 | /* SystemInitialize for Outport: '<S619>/RX status' */ |
| 33009 | L4_MABX_B.SFunction1_o3_gz = L4_MABX_P.RXstatus_Y0_h; |
| 33010 | |
| 33011 | /* SystemInitialize for Outport: '<S619>/RX time' */ |
| 33012 | L4_MABX_B.SFunction1_o4_hf3 = L4_MABX_P.RXtime_Y0_cf; |
| 33013 | |
| 33014 | /* SystemInitialize for Outport: '<S619>/RX delta time' */ |
| 33015 | L4_MABX_B.SFunction1_o5_p5 = L4_MABX_P.RXdeltatime_Y0_oy; |
| 33016 | |
| 33017 | /* End of SystemInitialize for SubSystem: '<S615>/CAN_TYPE1_RX_M1_C2' */ |
| 33018 | |
| 33019 | /* SystemInitialize for Enabled SubSystem: '<S616>/CAN_TYPE1_RX_M2_C1' */ |
| 33020 | /* SystemInitialize for Outport: '<S620>/EPBPCMInhibitStatusFeedback' */ |
| 33021 | L4_MABX_B.SFunction1_o1_n0 = L4_MABX_P.EPBPCMInhibitStatusFeedback_Y_a; |
| 33022 | |
| 33023 | /* SystemInitialize for Outport: '<S620>/EPBPCMManualStatusFeedback' */ |
| 33024 | L4_MABX_B.SFunction1_o2_fk = L4_MABX_P.EPBPCMManualStatusFeedback_Y0_k; |
| 33025 | |
| 33026 | /* SystemInitialize for Outport: '<S620>/RX status' */ |
| 33027 | L4_MABX_B.SFunction1_o3_p = L4_MABX_P.RXstatus_Y0_ll; |
| 33028 | |
| 33029 | /* SystemInitialize for Outport: '<S620>/RX time' */ |
| 33030 | L4_MABX_B.SFunction1_o4_au = L4_MABX_P.RXtime_Y0_in; |
| 33031 | |
| 33032 | /* SystemInitialize for Outport: '<S620>/RX delta time' */ |
| 33033 | L4_MABX_B.SFunction1_o5_ne = L4_MABX_P.RXdeltatime_Y0_jk; |
| 33034 | |
| 33035 | /* End of SystemInitialize for SubSystem: '<S616>/CAN_TYPE1_RX_M2_C1' */ |
| 33036 | |
| 33037 | /* SystemInitialize for Enabled SubSystem: '<S627>/PX2_LaneEdgeLeft' */ |
| 33038 | /* SystemInitialize for Outport: '<S628>/PX2_LaneEdgeLeftAngle' */ |
| 33039 | L4_MABX_B.SFunction1_o1_mj = L4_MABX_P.PX2_LaneEdgeLeftAngle_Y0; |
| 33040 | |
| 33041 | /* SystemInitialize for Outport: '<S628>/PX2_LaneEdgeLeftNumPoints' */ |
| 33042 | L4_MABX_B.SFunction1_o2_ls = L4_MABX_P.PX2_LaneEdgeLeftNumPoints_Y0; |
| 33043 | |
| 33044 | /* SystemInitialize for Outport: '<S628>/PX2_LaneEdgeLeftPosition' */ |
| 33045 | L4_MABX_B.SFunction1_o3_c1 = L4_MABX_P.PX2_LaneEdgeLeftPosition_Y0; |
| 33046 | |
| 33047 | /* SystemInitialize for Outport: '<S628>/RX status' */ |
| 33048 | L4_MABX_B.SFunction1_o4_fz = L4_MABX_P.RXstatus_Y0_nm; |
| 33049 | |
| 33050 | /* SystemInitialize for Outport: '<S628>/RX time' */ |
| 33051 | L4_MABX_B.SFunction1_o5_e = L4_MABX_P.RXtime_Y0_g1; |
| 33052 | |
| 33053 | /* SystemInitialize for Outport: '<S628>/RX delta time' */ |
| 33054 | L4_MABX_B.SFunction1_o6_l0 = L4_MABX_P.RXdeltatime_Y0_go; |
| 33055 | |
| 33056 | /* End of SystemInitialize for SubSystem: '<S627>/PX2_LaneEdgeLeft' */ |
| 33057 | |
| 33058 | /* SystemInitialize for Enabled SubSystem: '<S627>/PX2_LaneEdgeRight' */ |
| 33059 | /* SystemInitialize for Outport: '<S629>/PX2_LaneEdgeRightAngle' */ |
| 33060 | L4_MABX_B.SFunction1_o1_i2 = L4_MABX_P.PX2_LaneEdgeRightAngle_Y0; |
| 33061 | |
| 33062 | /* SystemInitialize for Outport: '<S629>/PX2_LaneEdgeRightNumPoints' */ |
| 33063 | L4_MABX_B.SFunction1_o2_dg = L4_MABX_P.PX2_LaneEdgeRightNumPoints_Y0; |
| 33064 | |
| 33065 | /* SystemInitialize for Outport: '<S629>/PX2_LaneEdgeRightPosition' */ |
| 33066 | L4_MABX_B.SFunction1_o3_ad = L4_MABX_P.PX2_LaneEdgeRightPosition_Y0; |
| 33067 | |
| 33068 | /* SystemInitialize for Outport: '<S629>/RX status' */ |
| 33069 | L4_MABX_B.SFunction1_o4_dh = L4_MABX_P.RXstatus_Y0_ir; |
| 33070 | |
| 33071 | /* SystemInitialize for Outport: '<S629>/RX time' */ |
| 33072 | L4_MABX_B.SFunction1_o5_fm = L4_MABX_P.RXtime_Y0_g10; |
| 33073 | |
| 33074 | /* SystemInitialize for Outport: '<S629>/RX delta time' */ |
| 33075 | L4_MABX_B.SFunction1_o6_h = L4_MABX_P.RXdeltatime_Y0_o3; |
| 33076 | |
| 33077 | /* End of SystemInitialize for SubSystem: '<S627>/PX2_LaneEdgeRight' */ |
| 33078 | |
| 33079 | /* SystemInitialize for Enabled SubSystem: '<S638>/PX2_MapLaneEgoLeft' */ |
| 33080 | /* SystemInitialize for Outport: '<S639>/PX2_MapLaneNearPos' */ |
| 33081 | L4_MABX_B.SFunction1_o1_ed = L4_MABX_P.PX2_MapLaneNearPos_Y0; |
| 33082 | |
| 33083 | /* SystemInitialize for Outport: '<S639>/PX2_MapLaneMidPos' */ |
| 33084 | L4_MABX_B.SFunction1_o2_iv = L4_MABX_P.PX2_MapLaneMidPos_Y0; |
| 33085 | |
| 33086 | /* SystemInitialize for Outport: '<S639>/PX2_MapLaneFarPos' */ |
| 33087 | L4_MABX_B.SFunction1_o3_df = L4_MABX_P.PX2_MapLaneFarPos_Y0; |
| 33088 | |
| 33089 | /* SystemInitialize for Outport: '<S639>/PX2_EgoLaneNearPosValid' */ |
| 33090 | L4_MABX_B.SFunction1_o4_ak = L4_MABX_P.PX2_EgoLaneNearPosValid_Y0; |
| 33091 | |
| 33092 | /* SystemInitialize for Outport: '<S639>/PX2_EgoLaneMidPosValid' */ |
| 33093 | L4_MABX_B.SFunction1_o5_f1 = L4_MABX_P.PX2_EgoLaneMidPosValid_Y0; |
| 33094 | |
| 33095 | /* SystemInitialize for Outport: '<S639>/PX2_EgoLaneFarPosValid' */ |
| 33096 | L4_MABX_B.SFunction1_o6_i = L4_MABX_P.PX2_EgoLaneFarPosValid_Y0; |
| 33097 | |
| 33098 | /* SystemInitialize for Outport: '<S639>/RX status' */ |
| 33099 | L4_MABX_B.SFunction1_o7_c5 = L4_MABX_P.RXstatus_Y0_a5; |
| 33100 | |
| 33101 | /* SystemInitialize for Outport: '<S639>/RX time' */ |
| 33102 | L4_MABX_B.SFunction1_o8_e = L4_MABX_P.RXtime_Y0_bt; |
| 33103 | |
| 33104 | /* SystemInitialize for Outport: '<S639>/RX delta time' */ |
| 33105 | L4_MABX_B.SFunction1_o9_g = L4_MABX_P.RXdeltatime_Y0_br; |
| 33106 | |
| 33107 | /* End of SystemInitialize for SubSystem: '<S638>/PX2_MapLaneEgoLeft' */ |
| 33108 | |
| 33109 | /* SystemInitialize for Enabled SubSystem: '<S640>/PX2_MapLaneEgoRight' */ |
| 33110 | /* SystemInitialize for Outport: '<S641>/PX2_MapLaneNearPos' */ |
| 33111 | L4_MABX_B.SFunction1_o1_m5 = L4_MABX_P.PX2_MapLaneNearPos_Y0_k; |
| 33112 | |
| 33113 | /* SystemInitialize for Outport: '<S641>/PX2_MapLaneMidPos' */ |
| 33114 | L4_MABX_B.SFunction1_o2_dv = L4_MABX_P.PX2_MapLaneMidPos_Y0_i; |
| 33115 | |
| 33116 | /* SystemInitialize for Outport: '<S641>/PX2_MapLaneFarPos' */ |
| 33117 | L4_MABX_B.SFunction1_o3_em = L4_MABX_P.PX2_MapLaneFarPos_Y0_d; |
| 33118 | |
| 33119 | /* SystemInitialize for Outport: '<S641>/PX2_EgoLaneNearPosValid' */ |
| 33120 | L4_MABX_B.SFunction1_o4_mn = L4_MABX_P.PX2_EgoLaneNearPosValid_Y0_o; |
| 33121 | |
| 33122 | /* SystemInitialize for Outport: '<S641>/PX2_EgoLaneMidPosValid' */ |
| 33123 | L4_MABX_B.SFunction1_o5_gr = L4_MABX_P.PX2_EgoLaneMidPosValid_Y0_a; |
| 33124 | |
| 33125 | /* SystemInitialize for Outport: '<S641>/PX2_EgoLaneFarPosValid' */ |
| 33126 | L4_MABX_B.SFunction1_o6_n = L4_MABX_P.PX2_EgoLaneFarPosValid_Y0_m; |
| 33127 | |
| 33128 | /* SystemInitialize for Outport: '<S641>/RX status' */ |
| 33129 | L4_MABX_B.SFunction1_o7_fg = L4_MABX_P.RXstatus_Y0_i2t; |
| 33130 | |
| 33131 | /* SystemInitialize for Outport: '<S641>/RX time' */ |
| 33132 | L4_MABX_B.SFunction1_o8_a = L4_MABX_P.RXtime_Y0_ew; |
| 33133 | |
| 33134 | /* SystemInitialize for Outport: '<S641>/RX delta time' */ |
| 33135 | L4_MABX_B.SFunction1_o9_k = L4_MABX_P.RXdeltatime_Y0_ei; |
| 33136 | |
| 33137 | /* End of SystemInitialize for SubSystem: '<S640>/PX2_MapLaneEgoRight' */ |
| 33138 | |
| 33139 | /* SystemInitialize for Enabled SubSystem: '<S642>/PX2_EgoLanePos' */ |
| 33140 | /* SystemInitialize for Outport: '<S643>/PX2_EgoLaneNearPosErr' */ |
| 33141 | L4_MABX_B.SFunction1_o1_kz = L4_MABX_P.PX2_EgoLaneNearPosErr_Y0; |
| 33142 | |
| 33143 | /* SystemInitialize for Outport: '<S643>/PX2_EgoLaneMidPosErr' */ |
| 33144 | L4_MABX_B.SFunction1_o2_bb = L4_MABX_P.PX2_EgoLaneMidPosErr_Y0; |
| 33145 | |
| 33146 | /* SystemInitialize for Outport: '<S643>/PX2_EgoLaneFarPosErr' */ |
| 33147 | L4_MABX_B.SFunction1_o3_n = L4_MABX_P.PX2_EgoLaneFarPosErr_Y0; |
| 33148 | |
| 33149 | /* SystemInitialize for Outport: '<S643>/PX2_EgoLaneNearPosValid' */ |
| 33150 | L4_MABX_B.SFunction1_o4_gq = L4_MABX_P.PX2_EgoLaneNearPosValid_Y0_e; |
| 33151 | |
| 33152 | /* SystemInitialize for Outport: '<S643>/PX2_EgoLaneMidPosValid' */ |
| 33153 | L4_MABX_B.SFunction1_o5_p = L4_MABX_P.PX2_EgoLaneMidPosValid_Y0_p; |
| 33154 | |
| 33155 | /* SystemInitialize for Outport: '<S643>/PX2_EgoLaneFarPosValid' */ |
| 33156 | L4_MABX_B.SFunction1_o6_g = L4_MABX_P.PX2_EgoLaneFarPosValid_Y0_c; |
| 33157 | |
| 33158 | /* SystemInitialize for Outport: '<S643>/RX status' */ |
| 33159 | L4_MABX_B.SFunction1_o7_l = L4_MABX_P.RXstatus_Y0_jn; |
| 33160 | |
| 33161 | /* SystemInitialize for Outport: '<S643>/RX time' */ |
| 33162 | L4_MABX_B.SFunction1_o8_n = L4_MABX_P.RXtime_Y0_hp; |
| 33163 | |
| 33164 | /* SystemInitialize for Outport: '<S643>/RX delta time' */ |
| 33165 | L4_MABX_B.SFunction1_o9_c = L4_MABX_P.RXdeltatime_Y0_au; |
| 33166 | |
| 33167 | /* End of SystemInitialize for SubSystem: '<S642>/PX2_EgoLanePos' */ |
| 33168 | |
| 33169 | /* SystemInitialize for Enabled SubSystem: '<S652>/VEP1' */ |
| 33170 | /* SystemInitialize for Outport: '<S653>/NetBatteryCurrent' */ |
| 33171 | L4_MABX_B.SFunction1_o1_d = L4_MABX_P.NetBatteryCurrent_Y0; |
| 33172 | |
| 33173 | /* SystemInitialize for Outport: '<S653>/AltCurrent' */ |
| 33174 | L4_MABX_B.SFunction1_o2_lz = L4_MABX_P.AltCurrent_Y0; |
| 33175 | |
| 33176 | /* SystemInitialize for Outport: '<S653>/ChargingSystemPotential' */ |
| 33177 | L4_MABX_B.SFunction1_o3_j5 = L4_MABX_P.ChargingSystemPotential_Y0; |
| 33178 | |
| 33179 | /* SystemInitialize for Outport: '<S653>/BatteryPotential_PowerInput1' */ |
| 33180 | L4_MABX_B.SFunction1_o4_pz = L4_MABX_P.BatteryPotential_PowerInput1_Y0; |
| 33181 | |
| 33182 | /* SystemInitialize for Outport: '<S653>/KeyswitchBatteryPotential' */ |
| 33183 | L4_MABX_B.SFunction1_o5 = L4_MABX_P.KeyswitchBatteryPotential_Y0; |
| 33184 | |
| 33185 | /* SystemInitialize for Outport: '<S653>/RX status' */ |
| 33186 | L4_MABX_B.SFunction1_o6 = L4_MABX_P.RXstatus_Y0_bs; |
| 33187 | |
| 33188 | /* SystemInitialize for Outport: '<S653>/RX time' */ |
| 33189 | L4_MABX_B.SFunction1_o7 = L4_MABX_P.RXtime_Y0_o; |
| 33190 | |
| 33191 | /* SystemInitialize for Outport: '<S653>/RX delta time' */ |
| 33192 | L4_MABX_B.SFunction1_o8 = L4_MABX_P.RXdeltatime_Y0_ky5; |
| 33193 | |
| 33194 | /* End of SystemInitialize for SubSystem: '<S652>/VEP1' */ |
| 33195 | |
| 33196 | /* SystemInitialize for Enabled SubSystem: '<S475>/Decode_TPCM_CTS' */ |
| 33197 | /* SystemInitialize for Outport: '<S694>/Out' */ |
| 33198 | L4_MABX_B.SPN2556_ControlByte_k = (uint8_T)L4_MABX_P.Out_Y0_l; |
| 33199 | L4_MABX_B.SPN2561_NumberOfPacketsThatCanB = (uint8_T)L4_MABX_P.Out_Y0_l; |
| 33200 | L4_MABX_B.SPN2562_NextPacketNumberToBeSen = (uint8_T)L4_MABX_P.Out_Y0_l; |
| 33201 | L4_MABX_B.DataType_b1 = (uint32_T)L4_MABX_P.Out_Y0_l; |
| 33202 | |
| 33203 | /* End of SystemInitialize for SubSystem: '<S475>/Decode_TPCM_CTS' */ |
| 33204 | |
| 33205 | /* SystemInitialize for Enabled SubSystem: '<S475>/Decode_TPCM_ConnectionAbort' */ |
| 33206 | /* SystemInitialize for Outport: '<S695>/Out' */ |
| 33207 | L4_MABX_B.SPN2556_ControlByte_g = (uint8_T)L4_MABX_P.Out_Y0_a; |
| 33208 | L4_MABX_B.SPN2570_ConnectionAbortReason = (uint8_T)L4_MABX_P.Out_Y0_a; |
| 33209 | L4_MABX_B.DataType_pd = (uint32_T)L4_MABX_P.Out_Y0_a; |
| 33210 | |
| 33211 | /* End of SystemInitialize for SubSystem: '<S475>/Decode_TPCM_ConnectionAbort' */ |
| 33212 | |
| 33213 | /* SystemInitialize for Enabled SubSystem: '<S475>/Decode_TPCM_EndOfMessageAck' */ |
| 33214 | /* SystemInitialize for Outport: '<S696>/Out' */ |
| 33215 | L4_MABX_B.SPN2556_ControlByte_i = (uint8_T)L4_MABX_P.Out_Y0_d; |
| 33216 | L4_MABX_B.DataType_ilc = (uint16_T)L4_MABX_P.Out_Y0_d; |
| 33217 | L4_MABX_B.SPN2565_TotalNumberOfPackets = (uint8_T)L4_MABX_P.Out_Y0_d; |
| 33218 | L4_MABX_B.DataType_m2 = (uint32_T)L4_MABX_P.Out_Y0_d; |
| 33219 | |
| 33220 | /* End of SystemInitialize for SubSystem: '<S475>/Decode_TPCM_EndOfMessageAck' */ |
| 33221 | |
| 33222 | /* SystemInitialize for Enabled SubSystem: '<S475>/Decode_TPCM_RTS' */ |
| 33223 | /* SystemInitialize for Outport: '<S697>/Out' */ |
| 33224 | L4_MABX_B.SPN2556_ControlByte = (uint8_T)L4_MABX_P.Out_Y0_k; |
| 33225 | L4_MABX_B.DataType_fn = (uint16_T)L4_MABX_P.Out_Y0_k; |
| 33226 | L4_MABX_B.SPN2558_TotalNumberOfPackets = (uint8_T)L4_MABX_P.Out_Y0_k; |
| 33227 | L4_MABX_B.SPN2559_MaximumNumberOfPackets = (uint8_T)L4_MABX_P.Out_Y0_k; |
| 33228 | L4_MABX_B.DataType_ke = (uint32_T)L4_MABX_P.Out_Y0_k; |
| 33229 | |
| 33230 | /* End of SystemInitialize for SubSystem: '<S475>/Decode_TPCM_RTS' */ |
| 33231 | |
| 33232 | /* SystemInitialize for Enabled SubSystem: '<S588>/CAN_TYPE1_RX_M1_C1' */ |
| 33233 | /* SystemInitialize for Outport: '<S592>/byte1' */ |
| 33234 | L4_MABX_B.SFunction1_o1_f0 = L4_MABX_P.byte1_Y0_g; |
| 33235 | |
| 33236 | /* SystemInitialize for Outport: '<S592>/byte2' */ |
| 33237 | L4_MABX_B.SFunction1_o2_pl = L4_MABX_P.byte2_Y0_n; |
| 33238 | |
| 33239 | /* SystemInitialize for Outport: '<S592>/byte3' */ |
| 33240 | L4_MABX_B.SFunction1_o3_pe = L4_MABX_P.byte3_Y0_m; |
| 33241 | |
| 33242 | /* SystemInitialize for Outport: '<S592>/byte4' */ |
| 33243 | L4_MABX_B.SFunction1_o4_h2 = L4_MABX_P.byte4_Y0_l; |
| 33244 | |
| 33245 | /* SystemInitialize for Outport: '<S592>/byte5' */ |
| 33246 | L4_MABX_B.SFunction1_o5_m0 = L4_MABX_P.byte5_Y0_c; |
| 33247 | |
| 33248 | /* SystemInitialize for Outport: '<S592>/byte6' */ |
| 33249 | L4_MABX_B.SFunction1_o6_b1 = L4_MABX_P.byte6_Y0_m; |
| 33250 | |
| 33251 | /* SystemInitialize for Outport: '<S592>/byte7' */ |
| 33252 | L4_MABX_B.SFunction1_o7_al = L4_MABX_P.byte7_Y0_i; |
| 33253 | |
| 33254 | /* SystemInitialize for Outport: '<S592>/byte8' */ |
| 33255 | L4_MABX_B.SFunction1_o8_ar = L4_MABX_P.byte8_Y0_m; |
| 33256 | |
| 33257 | /* SystemInitialize for Outport: '<S592>/RX status' */ |
| 33258 | L4_MABX_B.SFunction1_o9_i4 = L4_MABX_P.RXstatus_Y0_fg; |
| 33259 | |
| 33260 | /* SystemInitialize for Outport: '<S592>/RX time' */ |
| 33261 | L4_MABX_B.SFunction1_o10_hc = L4_MABX_P.RXtime_Y0_p; |
| 33262 | |
| 33263 | /* SystemInitialize for Outport: '<S592>/RX delta time' */ |
| 33264 | L4_MABX_B.SFunction1_o11_n = L4_MABX_P.RXdeltatime_Y0_pn; |
| 33265 | |
| 33266 | /* End of SystemInitialize for SubSystem: '<S588>/CAN_TYPE1_RX_M1_C1' */ |
| 33267 | |
| 33268 | /* SystemInitialize for Enabled SubSystem: '<S589>/CAN_TYPE1_RX_M1_C2' */ |
| 33269 | /* SystemInitialize for Outport: '<S593>/byte1' */ |
| 33270 | L4_MABX_B.SFunction1_o1_np = L4_MABX_P.byte1_Y0_j; |
| 33271 | |
| 33272 | /* SystemInitialize for Outport: '<S593>/byte2' */ |
| 33273 | L4_MABX_B.SFunction1_o2_bp = L4_MABX_P.byte2_Y0_m; |
| 33274 | |
| 33275 | /* SystemInitialize for Outport: '<S593>/byte3' */ |
| 33276 | L4_MABX_B.SFunction1_o3_cq = L4_MABX_P.byte3_Y0_f; |
| 33277 | |
| 33278 | /* SystemInitialize for Outport: '<S593>/byte4' */ |
| 33279 | L4_MABX_B.SFunction1_o4_ph = L4_MABX_P.byte4_Y0_e; |
| 33280 | |
| 33281 | /* SystemInitialize for Outport: '<S593>/byte5' */ |
| 33282 | L4_MABX_B.SFunction1_o5_iy = L4_MABX_P.byte5_Y0_f; |
| 33283 | |
| 33284 | /* SystemInitialize for Outport: '<S593>/byte6' */ |
| 33285 | L4_MABX_B.SFunction1_o6_g4 = L4_MABX_P.byte6_Y0_my; |
| 33286 | |
| 33287 | /* SystemInitialize for Outport: '<S593>/byte7' */ |
| 33288 | L4_MABX_B.SFunction1_o7_ea = L4_MABX_P.byte7_Y0_l; |
| 33289 | |
| 33290 | /* SystemInitialize for Outport: '<S593>/byte8' */ |
| 33291 | L4_MABX_B.SFunction1_o8_c = L4_MABX_P.byte8_Y0_d; |
| 33292 | |
| 33293 | /* SystemInitialize for Outport: '<S593>/RX status' */ |
| 33294 | L4_MABX_B.SFunction1_o9_jm = L4_MABX_P.RXstatus_Y0_go; |
| 33295 | |
| 33296 | /* SystemInitialize for Outport: '<S593>/RX time' */ |
| 33297 | L4_MABX_B.SFunction1_o10_o = L4_MABX_P.RXtime_Y0_e; |
| 33298 | |
| 33299 | /* SystemInitialize for Outport: '<S593>/RX delta time' */ |
| 33300 | L4_MABX_B.SFunction1_o11_fl = L4_MABX_P.RXdeltatime_Y0_am; |
| 33301 | |
| 33302 | /* End of SystemInitialize for SubSystem: '<S589>/CAN_TYPE1_RX_M1_C2' */ |
| 33303 | |
| 33304 | /* SystemInitialize for Enabled SubSystem: '<S590>/CAN_TYPE1_RX_M3_C2' */ |
| 33305 | /* SystemInitialize for Outport: '<S594>/byte1' */ |
| 33306 | L4_MABX_B.SFunction1_o1_ae = L4_MABX_P.byte1_Y0_l; |
| 33307 | |
| 33308 | /* SystemInitialize for Outport: '<S594>/byte2' */ |
| 33309 | L4_MABX_B.SFunction1_o2_nt = L4_MABX_P.byte2_Y0_o; |
| 33310 | |
| 33311 | /* SystemInitialize for Outport: '<S594>/byte3' */ |
| 33312 | L4_MABX_B.SFunction1_o3_ng = L4_MABX_P.byte3_Y0_b; |
| 33313 | |
| 33314 | /* SystemInitialize for Outport: '<S594>/byte4' */ |
| 33315 | L4_MABX_B.SFunction1_o4_okw = L4_MABX_P.byte4_Y0_f; |
| 33316 | |
| 33317 | /* SystemInitialize for Outport: '<S594>/byte5' */ |
| 33318 | L4_MABX_B.SFunction1_o5_l = L4_MABX_P.byte5_Y0_g; |
| 33319 | |
| 33320 | /* SystemInitialize for Outport: '<S594>/byte6' */ |
| 33321 | L4_MABX_B.SFunction1_o6_nq = L4_MABX_P.byte6_Y0_e; |
| 33322 | |
| 33323 | /* SystemInitialize for Outport: '<S594>/byte7' */ |
| 33324 | L4_MABX_B.SFunction1_o7_lb = L4_MABX_P.byte7_Y0_i0; |
| 33325 | |
| 33326 | /* SystemInitialize for Outport: '<S594>/byte8' */ |
| 33327 | L4_MABX_B.SFunction1_o8_bi = L4_MABX_P.byte8_Y0_h; |
| 33328 | |
| 33329 | /* SystemInitialize for Outport: '<S594>/RX status' */ |
| 33330 | L4_MABX_B.SFunction1_o9_kq = L4_MABX_P.RXstatus_Y0_pk; |
| 33331 | |
| 33332 | /* SystemInitialize for Outport: '<S594>/RX time' */ |
| 33333 | L4_MABX_B.SFunction1_o10_f = L4_MABX_P.RXtime_Y0_cl; |
| 33334 | |
| 33335 | /* SystemInitialize for Outport: '<S594>/RX delta time' */ |
| 33336 | L4_MABX_B.SFunction1_o11_o = L4_MABX_P.RXdeltatime_Y0_oj; |
| 33337 | |
| 33338 | /* End of SystemInitialize for SubSystem: '<S590>/CAN_TYPE1_RX_M3_C2' */ |
| 33339 | |
| 33340 | /* SystemInitialize for Enabled SubSystem: '<S601>/CAN_TYPE1_RX_M1_C1' */ |
| 33341 | /* SystemInitialize for Outport: '<S605>/byte1' */ |
| 33342 | L4_MABX_B.SFunction1_o1_nw = L4_MABX_P.byte1_Y0_k; |
| 33343 | |
| 33344 | /* SystemInitialize for Outport: '<S605>/byte2' */ |
| 33345 | L4_MABX_B.SFunction1_o2_bx = L4_MABX_P.byte2_Y0_b; |
| 33346 | |
| 33347 | /* SystemInitialize for Outport: '<S605>/byte3' */ |
| 33348 | L4_MABX_B.SFunction1_o3_hu = L4_MABX_P.byte3_Y0_c; |
| 33349 | |
| 33350 | /* SystemInitialize for Outport: '<S605>/byte4' */ |
| 33351 | L4_MABX_B.SFunction1_o4_i2 = L4_MABX_P.byte4_Y0_kh; |
| 33352 | |
| 33353 | /* SystemInitialize for Outport: '<S605>/byte5' */ |
| 33354 | L4_MABX_B.SFunction1_o5_mc = L4_MABX_P.byte5_Y0_fc; |
| 33355 | |
| 33356 | /* SystemInitialize for Outport: '<S605>/byte6' */ |
| 33357 | L4_MABX_B.SFunction1_o6_bm = L4_MABX_P.byte6_Y0_f; |
| 33358 | |
| 33359 | /* SystemInitialize for Outport: '<S605>/byte7' */ |
| 33360 | L4_MABX_B.SFunction1_o7_p0 = L4_MABX_P.byte7_Y0_l0; |
| 33361 | |
| 33362 | /* SystemInitialize for Outport: '<S605>/byte8' */ |
| 33363 | L4_MABX_B.SFunction1_o8_j = L4_MABX_P.byte8_Y0_g; |
| 33364 | |
| 33365 | /* SystemInitialize for Outport: '<S605>/RX status' */ |
| 33366 | L4_MABX_B.SFunction1_o9_e = L4_MABX_P.RXstatus_Y0_pz; |
| 33367 | |
| 33368 | /* SystemInitialize for Outport: '<S605>/RX time' */ |
| 33369 | L4_MABX_B.SFunction1_o10_a = L4_MABX_P.RXtime_Y0_lz; |
| 33370 | |
| 33371 | /* SystemInitialize for Outport: '<S605>/RX delta time' */ |
| 33372 | L4_MABX_B.SFunction1_o11_f = L4_MABX_P.RXdeltatime_Y0_hu; |
| 33373 | |
| 33374 | /* End of SystemInitialize for SubSystem: '<S601>/CAN_TYPE1_RX_M1_C1' */ |
| 33375 | |
| 33376 | /* SystemInitialize for Enabled SubSystem: '<S602>/CAN_TYPE1_RX_M1_C2' */ |
| 33377 | /* SystemInitialize for Outport: '<S606>/byte1' */ |
| 33378 | L4_MABX_B.SFunction1_o1_dc = L4_MABX_P.byte1_Y0_o; |
| 33379 | |
| 33380 | /* SystemInitialize for Outport: '<S606>/byte2' */ |
| 33381 | L4_MABX_B.SFunction1_o2_bu = L4_MABX_P.byte2_Y0_p; |
| 33382 | |
| 33383 | /* SystemInitialize for Outport: '<S606>/byte3' */ |
| 33384 | L4_MABX_B.SFunction1_o3_mi = L4_MABX_P.byte3_Y0_i; |
| 33385 | |
| 33386 | /* SystemInitialize for Outport: '<S606>/byte4' */ |
| 33387 | L4_MABX_B.SFunction1_o4_hm = L4_MABX_P.byte4_Y0_m; |
| 33388 | |
| 33389 | /* SystemInitialize for Outport: '<S606>/byte5' */ |
| 33390 | L4_MABX_B.SFunction1_o5_bl = L4_MABX_P.byte5_Y0_cn; |
| 33391 | |
| 33392 | /* SystemInitialize for Outport: '<S606>/byte6' */ |
| 33393 | L4_MABX_B.SFunction1_o6_e = L4_MABX_P.byte6_Y0_j; |
| 33394 | |
| 33395 | /* SystemInitialize for Outport: '<S606>/byte7' */ |
| 33396 | L4_MABX_B.SFunction1_o7_cl = L4_MABX_P.byte7_Y0_j; |
| 33397 | |
| 33398 | /* SystemInitialize for Outport: '<S606>/byte8' */ |
| 33399 | L4_MABX_B.SFunction1_o8_d = L4_MABX_P.byte8_Y0_ho; |
| 33400 | |
| 33401 | /* SystemInitialize for Outport: '<S606>/RX status' */ |
| 33402 | L4_MABX_B.SFunction1_o9_o = L4_MABX_P.RXstatus_Y0_ku; |
| 33403 | |
| 33404 | /* SystemInitialize for Outport: '<S606>/RX time' */ |
| 33405 | L4_MABX_B.SFunction1_o10_p = L4_MABX_P.RXtime_Y0_dj; |
| 33406 | |
| 33407 | /* SystemInitialize for Outport: '<S606>/RX delta time' */ |
| 33408 | L4_MABX_B.SFunction1_o11_g = L4_MABX_P.RXdeltatime_Y0_jj; |
| 33409 | |
| 33410 | /* End of SystemInitialize for SubSystem: '<S602>/CAN_TYPE1_RX_M1_C2' */ |
| 33411 | |
| 33412 | /* SystemInitialize for Enabled SubSystem: '<S603>/CAN_TYPE1_RX_M3_C2' */ |
| 33413 | /* SystemInitialize for Outport: '<S607>/byte1' */ |
| 33414 | L4_MABX_B.SFunction1_o1_oz = L4_MABX_P.byte1_Y0_f; |
| 33415 | |
| 33416 | /* SystemInitialize for Outport: '<S607>/byte2' */ |
| 33417 | L4_MABX_B.SFunction1_o2_hr = L4_MABX_P.byte2_Y0_f; |
| 33418 | |
| 33419 | /* SystemInitialize for Outport: '<S607>/byte3' */ |
| 33420 | L4_MABX_B.SFunction1_o3_cc = L4_MABX_P.byte3_Y0_l; |
| 33421 | |
| 33422 | /* SystemInitialize for Outport: '<S607>/byte4' */ |
| 33423 | L4_MABX_B.SFunction1_o4_ok = L4_MABX_P.byte4_Y0_a; |
| 33424 | |
| 33425 | /* SystemInitialize for Outport: '<S607>/byte5' */ |
| 33426 | L4_MABX_B.SFunction1_o5_m = L4_MABX_P.byte5_Y0_a; |
| 33427 | |
| 33428 | /* SystemInitialize for Outport: '<S607>/byte6' */ |
| 33429 | L4_MABX_B.SFunction1_o6_p = L4_MABX_P.byte6_Y0_o; |
| 33430 | |
| 33431 | /* SystemInitialize for Outport: '<S607>/byte7' */ |
| 33432 | L4_MABX_B.SFunction1_o7_pe = L4_MABX_P.byte7_Y0_p; |
| 33433 | |
| 33434 | /* SystemInitialize for Outport: '<S607>/byte8' */ |
| 33435 | L4_MABX_B.SFunction1_o8_o = L4_MABX_P.byte8_Y0_n2; |
| 33436 | |
| 33437 | /* SystemInitialize for Outport: '<S607>/RX status' */ |
| 33438 | L4_MABX_B.SFunction1_o9_h = L4_MABX_P.RXstatus_Y0_a; |
| 33439 | |
| 33440 | /* SystemInitialize for Outport: '<S607>/RX time' */ |
| 33441 | L4_MABX_B.SFunction1_o10_c = L4_MABX_P.RXtime_Y0_k; |
| 33442 | |
| 33443 | /* SystemInitialize for Outport: '<S607>/RX delta time' */ |
| 33444 | L4_MABX_B.SFunction1_o11_a = L4_MABX_P.RXdeltatime_Y0_o0; |
| 33445 | |
| 33446 | /* End of SystemInitialize for SubSystem: '<S603>/CAN_TYPE1_RX_M3_C2' */ |
| 33447 | |
| 33448 | /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_1' */ |
| 33449 | /* InitializeConditions for UnitDelay: '<S30>/Unit_Delay' */ |
| 33450 | L4_MABX_DW.Unit_Delay_DSTATE_f1 = L4_MABX_P.Unit_Delay_InitialCondition_e3; |
| 33451 | |
| 33452 | /* InitializeConditions for UnitDelay: '<S31>/Unit Delay' */ |
| 33453 | L4_MABX_DW.UnitDelay_DSTATE_j1 = L4_MABX_P.UnitDelay_InitialCondition_nq; |
| 33454 | |
| 33455 | /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_1' */ |
| 33456 | |
| 33457 | /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_5' */ |
| 33458 | /* InitializeConditions for UnitDelay: '<S54>/Unit_Delay' */ |
| 33459 | L4_MABX_DW.Unit_Delay_DSTATE_i5 = L4_MABX_P.Unit_Delay_InitialCondition_ot; |
| 33460 | |
| 33461 | /* InitializeConditions for UnitDelay: '<S55>/Unit Delay' */ |
| 33462 | L4_MABX_DW.UnitDelay_DSTATE_p = L4_MABX_P.UnitDelay_InitialCondition_p; |
| 33463 | |
| 33464 | /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_5' */ |
| 33465 | |
| 33466 | /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_6' */ |
| 33467 | /* InitializeConditions for UnitDelay: '<S60>/Unit_Delay' */ |
| 33468 | L4_MABX_DW.Unit_Delay_DSTATE_l5 = L4_MABX_P.Unit_Delay_InitialCondition_le; |
| 33469 | |
| 33470 | /* InitializeConditions for UnitDelay: '<S61>/Unit Delay' */ |
| 33471 | L4_MABX_DW.UnitDelay_DSTATE_dr = L4_MABX_P.UnitDelay_InitialCondition_iv; |
| 33472 | |
| 33473 | /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_6' */ |
| 33474 | |
| 33475 | /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_3' */ |
| 33476 | /* InitializeConditions for UnitDelay: '<S42>/Unit_Delay' */ |
| 33477 | L4_MABX_DW.Unit_Delay_DSTATE_h41 = L4_MABX_P.Unit_Delay_InitialCondition_m; |
| 33478 | |
| 33479 | /* InitializeConditions for UnitDelay: '<S43>/Unit Delay' */ |
| 33480 | L4_MABX_DW.UnitDelay_DSTATE_dr4 = L4_MABX_P.UnitDelay_InitialCondition_hk; |
| 33481 | |
| 33482 | /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_3' */ |
| 33483 | |
| 33484 | /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_4' */ |
| 33485 | /* InitializeConditions for UnitDelay: '<S48>/Unit_Delay' */ |
| 33486 | L4_MABX_DW.Unit_Delay_DSTATE_mq = L4_MABX_P.Unit_Delay_InitialCondition_bo; |
| 33487 | |
| 33488 | /* InitializeConditions for UnitDelay: '<S49>/Unit Delay' */ |
| 33489 | L4_MABX_DW.UnitDelay_DSTATE_h = L4_MABX_P.UnitDelay_InitialCondition_l; |
| 33490 | |
| 33491 | /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_4' */ |
| 33492 | |
| 33493 | /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_2' */ |
| 33494 | /* InitializeConditions for UnitDelay: '<S36>/Unit_Delay' */ |
| 33495 | L4_MABX_DW.Unit_Delay_DSTATE_je = L4_MABX_P.Unit_Delay_InitialCondition_in; |
| 33496 | |
| 33497 | /* InitializeConditions for UnitDelay: '<S37>/Unit Delay' */ |
| 33498 | L4_MABX_DW.UnitDelay_DSTATE_b = L4_MABX_P.UnitDelay_InitialCondition_m; |
| 33499 | |
| 33500 | /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_2' */ |
| 33501 | } |
| 33502 | } |
| 33503 | |
| 33504 | /* Model terminate function */ |
| 33505 | void L4_MABX_terminate(void) |
| 33506 | { |
| 33507 | /* Terminate for Atomic SubSystem: '<S855>/CAN_TX_1000ms' */ |
| 33508 | |
| 33509 | /* Terminate for Enabled SubSystem: '<S875>/AIR1' */ |
| 33510 | |
| 33511 | /* Terminate for S-Function (rti_commonblock): '<S876>/S-Function1' */ |
| 33512 | |
| 33513 | /* dSPACE RTICAN TX Message Block: "AIR1" Id:419343921 */ |
| 33514 | { |
| 33515 | /* ... Set the message into sleep mode */ |
| 33516 | while ((rtican_type1_tq_error[1][3] = can_tp1_msg_sleep |
| 33517 | (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31])) == |
| 33518 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33519 | } |
| 33520 | |
| 33521 | /* End of Terminate for SubSystem: '<S875>/AIR1' */ |
| 33522 | |
| 33523 | /* Terminate for Enabled SubSystem: '<S883>/AMB' */ |
| 33524 | |
| 33525 | /* Terminate for S-Function (rti_commonblock): '<S884>/S-Function1' */ |
| 33526 | |
| 33527 | /* dSPACE RTICAN TX Message Block: "AMB" Id:419362048 */ |
| 33528 | { |
| 33529 | /* ... Set the message into sleep mode */ |
| 33530 | while ((rtican_type1_tq_error[1][4] = can_tp1_msg_sleep |
| 33531 | (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500])) == |
| 33532 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33533 | } |
| 33534 | |
| 33535 | /* End of Terminate for SubSystem: '<S883>/AMB' */ |
| 33536 | |
| 33537 | /* End of Terminate for SubSystem: '<S855>/CAN_TX_1000ms' */ |
| 33538 | |
| 33539 | /* Terminate for S-Function (dsa_tcpip_setup_sfcn): '<S405>/dsa_tcpip_setup' */ |
| 33540 | /* Level2 S-Function Block: '<S405>/dsa_tcpip_setup' (dsa_tcpip_setup_sfcn) */ |
| 33541 | { |
| 33542 | SimStruct *rts = L4_MABX_M->childSfunctions[3]; |
| 33543 | sfcnTerminate(rts); |
| 33544 | } |
| 33545 | |
| 33546 | /* Terminate for S-Function (dsa_tcpip_udp_sfcn): '<S406>/TCPIP_Com' */ |
| 33547 | /* Level2 S-Function Block: '<S406>/TCPIP_Com' (dsa_tcpip_udp_sfcn) */ |
| 33548 | { |
| 33549 | SimStruct *rts = L4_MABX_M->childSfunctions[4]; |
| 33550 | sfcnTerminate(rts); |
| 33551 | } |
| 33552 | |
| 33553 | /* Terminate for Atomic SubSystem: '<S855>/CAN_TX_100ms' */ |
| 33554 | |
| 33555 | /* Terminate for Enabled SubSystem: '<S914>/PropB_XPR_FC' */ |
| 33556 | |
| 33557 | /* Terminate for S-Function (rti_commonblock): '<S916>/S-Function1' */ |
| 33558 | |
| 33559 | /* dSPACE RTICAN TX Message Block: "PropB_XPR_FC" Id:419366140 */ |
| 33560 | { |
| 33561 | /* ... Set the message into sleep mode */ |
| 33562 | while ((rtican_type1_tq_error[0][4] = can_tp1_msg_sleep |
| 33563 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC])) == |
| 33564 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33565 | } |
| 33566 | |
| 33567 | /* End of Terminate for SubSystem: '<S914>/PropB_XPR_FC' */ |
| 33568 | |
| 33569 | /* Terminate for Enabled SubSystem: '<S915>/PropB_XPR_FC' */ |
| 33570 | |
| 33571 | /* Terminate for S-Function (rti_commonblock): '<S917>/S-Function1' */ |
| 33572 | |
| 33573 | /* dSPACE RTICAN TX Message Block: "PropB_XPR_FC" Id:419366140 */ |
| 33574 | { |
| 33575 | /* ... Set the message into sleep mode */ |
| 33576 | while ((rtican_type1_tq_error[1][4] = can_tp1_msg_sleep |
| 33577 | (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC])) == |
| 33578 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33579 | } |
| 33580 | |
| 33581 | /* End of Terminate for SubSystem: '<S915>/PropB_XPR_FC' */ |
| 33582 | |
| 33583 | /* Terminate for Enabled SubSystem: '<S944>/Std_PosRapidUpdate_01' */ |
| 33584 | |
| 33585 | /* Terminate for S-Function (rti_commonblock): '<S945>/S-Function1' */ |
| 33586 | |
| 33587 | /* dSPACE RTICAN TX Message Block: "Std_PosRapidUpdate_01" Id:3 */ |
| 33588 | { |
| 33589 | /* ... Set the message into sleep mode */ |
| 33590 | while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep |
| 33591 | (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3])) == |
| 33592 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33593 | } |
| 33594 | |
| 33595 | /* End of Terminate for SubSystem: '<S944>/Std_PosRapidUpdate_01' */ |
| 33596 | |
| 33597 | /* Terminate for Enabled SubSystem: '<S894>/CCVS1_00' */ |
| 33598 | |
| 33599 | /* Terminate for S-Function (rti_commonblock): '<S896>/S-Function1' */ |
| 33600 | |
| 33601 | /* dSPACE RTICAN TX Message Block: "CCVS1_00" Id:419361024 */ |
| 33602 | { |
| 33603 | /* ... Set the message into sleep mode */ |
| 33604 | while ((rtican_type1_tq_error[0][3] = can_tp1_msg_sleep |
| 33605 | (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100])) == |
| 33606 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33607 | } |
| 33608 | |
| 33609 | /* End of Terminate for SubSystem: '<S894>/CCVS1_00' */ |
| 33610 | |
| 33611 | /* Terminate for Enabled SubSystem: '<S895>/CCVS1_00' */ |
| 33612 | |
| 33613 | /* Terminate for S-Function (rti_commonblock): '<S897>/S-Function1' */ |
| 33614 | |
| 33615 | /* dSPACE RTICAN TX Message Block: "CCVS1_00" Id:218034432 */ |
| 33616 | { |
| 33617 | /* ... Set the message into sleep mode */ |
| 33618 | while ((rtican_type1_tq_error[2][3] = can_tp1_msg_sleep |
| 33619 | (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100])) == |
| 33620 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33621 | } |
| 33622 | |
| 33623 | /* End of Terminate for SubSystem: '<S895>/CCVS1_00' */ |
| 33624 | |
| 33625 | /* Terminate for Enabled SubSystem: '<S898>/PropB_REAX_5_E4' */ |
| 33626 | |
| 33627 | /* Terminate for S-Function (rti_commonblock): '<S900>/S-Function1' incorporates: |
| 33628 | * Constant: '<S898>/Constant' |
| 33629 | * Constant: '<S898>/Constant1' |
| 33630 | */ |
| 33631 | |
| 33632 | /* dSPACE RTICAN TX Message Block: "PropB_REAX_5_E4" Id:419429092 */ |
| 33633 | { |
| 33634 | /* ... Set the message into sleep mode */ |
| 33635 | while ((rtican_type1_tq_error[0][5] = can_tp1_msg_sleep |
| 33636 | (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FFFAE4])) == |
| 33637 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33638 | } |
| 33639 | |
| 33640 | /* End of Terminate for SubSystem: '<S898>/PropB_REAX_5_E4' */ |
| 33641 | |
| 33642 | /* Terminate for Enabled SubSystem: '<S899>/PropB_REAX_5_E4' */ |
| 33643 | |
| 33644 | /* Terminate for S-Function (rti_commonblock): '<S901>/S-Function1' incorporates: |
| 33645 | * Constant: '<S899>/Constant' |
| 33646 | * Constant: '<S899>/Constant1' |
| 33647 | */ |
| 33648 | |
| 33649 | /* dSPACE RTICAN TX Message Block: "PropB_REAX_5_E4" Id:419429092 */ |
| 33650 | { |
| 33651 | /* ... Set the message into sleep mode */ |
| 33652 | while ((rtican_type1_tq_error[2][4] = can_tp1_msg_sleep |
| 33653 | (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0X18FFFAE4])) == |
| 33654 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33655 | } |
| 33656 | |
| 33657 | /* End of Terminate for SubSystem: '<S899>/PropB_REAX_5_E4' */ |
| 33658 | |
| 33659 | /* Terminate for Enabled SubSystem: '<S918>/Std_COGSOGRapidUpdate_01' */ |
| 33660 | |
| 33661 | /* Terminate for S-Function (rti_commonblock): '<S919>/S-Function1' incorporates: |
| 33662 | * Constant: '<S918>/Constant' |
| 33663 | * Constant: '<S918>/Constant1' |
| 33664 | */ |
| 33665 | |
| 33666 | /* dSPACE RTICAN TX Message Block: "Std_COGSOGRapidUpdate_01" Id:7 */ |
| 33667 | { |
| 33668 | /* ... Set the message into sleep mode */ |
| 33669 | while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep |
| 33670 | (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X7])) == |
| 33671 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33672 | } |
| 33673 | |
| 33674 | /* End of Terminate for SubSystem: '<S918>/Std_COGSOGRapidUpdate_01' */ |
| 33675 | |
| 33676 | /* Terminate for Enabled SubSystem: '<S920>/EBC1_TX' */ |
| 33677 | |
| 33678 | /* Terminate for S-Function (rti_commonblock): '<S921>/S-Function1' */ |
| 33679 | |
| 33680 | /* dSPACE RTICAN TX Message Block: "EBC1_TX" Id:418382219 */ |
| 33681 | { |
| 33682 | /* ... Set the message into sleep mode */ |
| 33683 | while ((rtican_type1_tq_error[0][2] = can_tp1_msg_sleep |
| 33684 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B])) == |
| 33685 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33686 | } |
| 33687 | |
| 33688 | /* End of Terminate for SubSystem: '<S920>/EBC1_TX' */ |
| 33689 | |
| 33690 | /* End of Terminate for SubSystem: '<S855>/CAN_TX_100ms' */ |
| 33691 | |
| 33692 | /* Terminate for Atomic SubSystem: '<S855>/CAN_TX_10ms' */ |
| 33693 | |
| 33694 | /* Terminate for Enabled SubSystem: '<S957>/ACCS' */ |
| 33695 | |
| 33696 | /* Terminate for S-Function (rti_commonblock): '<S958>/S-Function1' */ |
| 33697 | |
| 33698 | /* dSPACE RTICAN TX Message Block: "ACCS" Id:418393572 */ |
| 33699 | { |
| 33700 | /* ... Set the message into sleep mode */ |
| 33701 | while ((rtican_type1_tq_error[1][3] = can_tp1_msg_sleep |
| 33702 | (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4])) == |
| 33703 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33704 | } |
| 33705 | |
| 33706 | /* End of Terminate for SubSystem: '<S957>/ACCS' */ |
| 33707 | |
| 33708 | /* Terminate for Enabled SubSystem: '<S965>/EEC1_00' */ |
| 33709 | |
| 33710 | /* Terminate for S-Function (rti_commonblock): '<S967>/S-Function1' */ |
| 33711 | |
| 33712 | /* dSPACE RTICAN TX Message Block: "EEC1_00" Id:217056256 */ |
| 33713 | { |
| 33714 | /* ... Set the message into sleep mode */ |
| 33715 | while ((rtican_type1_tq_error[1][1] = can_tp1_msg_sleep |
| 33716 | (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400])) == |
| 33717 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33718 | } |
| 33719 | |
| 33720 | /* End of Terminate for SubSystem: '<S965>/EEC1_00' */ |
| 33721 | |
| 33722 | /* Terminate for Enabled SubSystem: '<S966>/EEC1_00' */ |
| 33723 | |
| 33724 | /* Terminate for S-Function (rti_commonblock): '<S968>/S-Function1' */ |
| 33725 | |
| 33726 | /* dSPACE RTICAN TX Message Block: "EEC1_00" Id:217056256 */ |
| 33727 | { |
| 33728 | /* ... Set the message into sleep mode */ |
| 33729 | while ((rtican_type1_tq_error[2][3] = can_tp1_msg_sleep |
| 33730 | (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400])) == |
| 33731 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33732 | } |
| 33733 | |
| 33734 | /* End of Terminate for SubSystem: '<S966>/EEC1_00' */ |
| 33735 | |
| 33736 | /* Terminate for Enabled SubSystem: '<S969>/PropB_REAX_1_E4' */ |
| 33737 | |
| 33738 | /* Terminate for S-Function (rti_commonblock): '<S971>/S-Function1' incorporates: |
| 33739 | * Constant: '<S969>/Constant' |
| 33740 | * Constant: '<S969>/Constant1' |
| 33741 | */ |
| 33742 | |
| 33743 | /* dSPACE RTICAN TX Message Block: "PropB_REAX_1_E4" Id:419426276 */ |
| 33744 | { |
| 33745 | /* ... Set the message into sleep mode */ |
| 33746 | while ((rtican_type1_tq_error[0][4] = can_tp1_msg_sleep |
| 33747 | (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FFEFE4])) == |
| 33748 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33749 | } |
| 33750 | |
| 33751 | /* End of Terminate for SubSystem: '<S969>/PropB_REAX_1_E4' */ |
| 33752 | |
| 33753 | /* Terminate for Enabled SubSystem: '<S970>/PropB_REAX_1_E4' */ |
| 33754 | |
| 33755 | /* Terminate for S-Function (rti_commonblock): '<S972>/S-Function1' incorporates: |
| 33756 | * Constant: '<S970>/Constant' |
| 33757 | * Constant: '<S970>/Constant1' |
| 33758 | */ |
| 33759 | |
| 33760 | /* dSPACE RTICAN TX Message Block: "PropB_REAX_1_E4" Id:419426276 */ |
| 33761 | { |
| 33762 | /* ... Set the message into sleep mode */ |
| 33763 | while ((rtican_type1_tq_error[2][4] = can_tp1_msg_sleep |
| 33764 | (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0X18FFEFE4])) == |
| 33765 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33766 | } |
| 33767 | |
| 33768 | /* End of Terminate for SubSystem: '<S970>/PropB_REAX_1_E4' */ |
| 33769 | |
| 33770 | /* Terminate for Enabled SubSystem: '<S979>/VDC2_0B' */ |
| 33771 | |
| 33772 | /* Terminate for S-Function (rti_commonblock): '<S980>/S-Function1' */ |
| 33773 | |
| 33774 | /* dSPACE RTICAN TX Message Block: "VDC2_0B" Id:418384139 */ |
| 33775 | { |
| 33776 | /* ... Set the message into sleep mode */ |
| 33777 | while ((rtican_type1_tq_error[2][4] = can_tp1_msg_sleep |
| 33778 | (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B])) == |
| 33779 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33780 | } |
| 33781 | |
| 33782 | /* End of Terminate for SubSystem: '<S979>/VDC2_0B' */ |
| 33783 | |
| 33784 | /* End of Terminate for SubSystem: '<S855>/CAN_TX_10ms' */ |
| 33785 | |
| 33786 | /* Terminate for Atomic SubSystem: '<S855>/CAN_TX_20ms' */ |
| 33787 | |
| 33788 | /* Terminate for Enabled SubSystem: '<S1024>/PropB_XBR_B3' */ |
| 33789 | |
| 33790 | /* Terminate for S-Function (rti_commonblock): '<S1025>/S-Function1' */ |
| 33791 | |
| 33792 | /* dSPACE RTICAN TX Message Block: "PropB_XBR_B3" Id:218038707 */ |
| 33793 | { |
| 33794 | /* ... Set the message into sleep mode */ |
| 33795 | while ((rtican_type1_tq_error[1][2] = can_tp1_msg_sleep |
| 33796 | (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3])) == |
| 33797 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33798 | } |
| 33799 | |
| 33800 | /* End of Terminate for SubSystem: '<S1024>/PropB_XBR_B3' */ |
| 33801 | |
| 33802 | /* Terminate for Enabled SubSystem: '<S1026>/PropB_Bendix_2C2_XPR' */ |
| 33803 | |
| 33804 | /* Terminate for S-Function (rti_commonblock): '<S1027>/S-Function1' */ |
| 33805 | |
| 33806 | /* dSPACE RTICAN TX Message Block: "PropB_Bendix_2C2_XPR" Id:218060389 */ |
| 33807 | { |
| 33808 | /* ... Set the message into sleep mode */ |
| 33809 | while ((rtican_type1_tq_error[1][2] = can_tp1_msg_sleep |
| 33810 | (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665])) == |
| 33811 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33812 | } |
| 33813 | |
| 33814 | /* End of Terminate for SubSystem: '<S1026>/PropB_Bendix_2C2_XPR' */ |
| 33815 | |
| 33816 | /* Terminate for Enabled SubSystem: '<S1034>/Std_OdometryData' */ |
| 33817 | |
| 33818 | /* Terminate for S-Function (rti_commonblock): '<S1035>/S-Function1' */ |
| 33819 | |
| 33820 | /* dSPACE RTICAN TX Message Block: "Std_OdometryData" Id:10 */ |
| 33821 | { |
| 33822 | /* ... Set the message into sleep mode */ |
| 33823 | while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep |
| 33824 | (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA])) == |
| 33825 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33826 | } |
| 33827 | |
| 33828 | /* End of Terminate for SubSystem: '<S1034>/Std_OdometryData' */ |
| 33829 | |
| 33830 | /* End of Terminate for SubSystem: '<S855>/CAN_TX_20ms' */ |
| 33831 | |
| 33832 | /* Terminate for Atomic SubSystem: '<S855>/CAN_TX_5000ms' */ |
| 33833 | |
| 33834 | /* Terminate for Enabled SubSystem: '<S1049>/RQST_13_E4' */ |
| 33835 | |
| 33836 | /* Terminate for S-Function (rti_commonblock): '<S1051>/S-Function1' */ |
| 33837 | |
| 33838 | /* dSPACE RTICAN TX Message Block: "RQST_13_E4" Id:417993700 */ |
| 33839 | { |
| 33840 | /* ... Set the message into sleep mode */ |
| 33841 | while ((rtican_type1_tq_error[2][3] = can_tp1_msg_sleep |
| 33842 | (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4])) == |
| 33843 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33844 | } |
| 33845 | |
| 33846 | /* End of Terminate for SubSystem: '<S1049>/RQST_13_E4' */ |
| 33847 | |
| 33848 | /* End of Terminate for SubSystem: '<S855>/CAN_TX_5000ms' */ |
| 33849 | |
| 33850 | /* Terminate for Atomic SubSystem: '<S855>/CAN_TX_50ms' */ |
| 33851 | |
| 33852 | /* Terminate for Enabled SubSystem: '<S1060>/CCVS1_E3' */ |
| 33853 | |
| 33854 | /* Terminate for S-Function (rti_commonblock): '<S1062>/S-Function1' */ |
| 33855 | |
| 33856 | /* dSPACE RTICAN TX Message Block: "CCVS1_E3" Id:419361251 */ |
| 33857 | { |
| 33858 | /* ... Set the message into sleep mode */ |
| 33859 | while ((rtican_type1_tq_error[1][3] = can_tp1_msg_sleep |
| 33860 | (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3])) == |
| 33861 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33862 | } |
| 33863 | |
| 33864 | /* End of Terminate for SubSystem: '<S1060>/CCVS1_E3' */ |
| 33865 | |
| 33866 | /* Terminate for Enabled SubSystem: '<S1061>/TC1_03_05' */ |
| 33867 | |
| 33868 | /* Terminate for S-Function (rti_commonblock): '<S1063>/S-Function1' */ |
| 33869 | |
| 33870 | /* dSPACE RTICAN TX Message Block: "TC1_03_05" Id:201392901 */ |
| 33871 | { |
| 33872 | /* ... Set the message into sleep mode */ |
| 33873 | while ((rtican_type1_tq_error[0][0] = can_tp1_msg_sleep |
| 33874 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305])) == |
| 33875 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33876 | } |
| 33877 | |
| 33878 | /* End of Terminate for SubSystem: '<S1061>/TC1_03_05' */ |
| 33879 | |
| 33880 | /* End of Terminate for SubSystem: '<S855>/CAN_TX_50ms' */ |
| 33881 | |
| 33882 | /* Terminate for Enabled SubSystem: '<S1073>/Std_SystemTime_01' */ |
| 33883 | |
| 33884 | /* Terminate for S-Function (rti_commonblock): '<S1075>/S-Function1' incorporates: |
| 33885 | * Constant: '<S1073>/Constant' |
| 33886 | * Constant: '<S1073>/Constant1' |
| 33887 | */ |
| 33888 | |
| 33889 | /* dSPACE RTICAN TX Message Block: "Std_SystemTime_01" Id:5 */ |
| 33890 | { |
| 33891 | /* ... Set the message into sleep mode */ |
| 33892 | while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep |
| 33893 | (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X5])) == |
| 33894 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33895 | } |
| 33896 | |
| 33897 | /* End of Terminate for SubSystem: '<S1073>/Std_SystemTime_01' */ |
| 33898 | |
| 33899 | /* Terminate for Triggered SubSystem: '<S1068>/CAN_TYPE1_TX_M1_C1' */ |
| 33900 | |
| 33901 | /* Terminate for S-Function (rti_commonblock): '<S1070>/S-Function1' */ |
| 33902 | |
| 33903 | /* dSPACE RTICAN TX Message Block: "TX Message" Id:418184965 */ |
| 33904 | { |
| 33905 | /* ... Set the message into sleep mode */ |
| 33906 | while ((rtican_type1_tq_error[0][1] = can_tp1_msg_sleep |
| 33907 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05])) == |
| 33908 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33909 | } |
| 33910 | |
| 33911 | /* End of Terminate for SubSystem: '<S1068>/CAN_TYPE1_TX_M1_C1' */ |
| 33912 | |
| 33913 | /* Terminate for Triggered SubSystem: '<S1069>/CAN_TYPE1_TX_M1_C1' */ |
| 33914 | |
| 33915 | /* Terminate for S-Function (rti_commonblock): '<S1071>/S-Function1' */ |
| 33916 | |
| 33917 | /* dSPACE RTICAN TX Message Block: "TX Message" Id:418119429 */ |
| 33918 | { |
| 33919 | /* ... Set the message into sleep mode */ |
| 33920 | while ((rtican_type1_tq_error[0][1] = can_tp1_msg_sleep |
| 33921 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05])) == |
| 33922 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33923 | } |
| 33924 | |
| 33925 | /* End of Terminate for SubSystem: '<S1069>/CAN_TYPE1_TX_M1_C1' */ |
| 33926 | |
| 33927 | /* Terminate for S-Function (rti_commonblock): '<S1076>/S-Function1' */ |
| 33928 | |
| 33929 | /* disable digital output channel 1 on port 1 * |
| 33930 | * (set to high-impedance), when the simulation terminates */ |
| 33931 | dio_tp4_digout_init(DIO_TP4_1_MODULE_ADDR, 1, DIO_TP4_MASK_CH1, |
| 33932 | DIO_TP4_LS_DISABLE, DIO_TP4_HS_DISABLE); |
| 33933 | |
| 33934 | /* Terminate for S-Function (rti_commonblock): '<S1077>/S-Function1' */ |
| 33935 | |
| 33936 | /* disable digital output channel 2 on port 1 * |
| 33937 | * (set to high-impedance), when the simulation terminates */ |
| 33938 | dio_tp4_digout_init(DIO_TP4_1_MODULE_ADDR, 1, DIO_TP4_MASK_CH2, |
| 33939 | DIO_TP4_LS_DISABLE, DIO_TP4_HS_DISABLE); |
| 33940 | |
| 33941 | /* Terminate for S-Function (rti_commonblock): '<S1078>/S-Function1' */ |
| 33942 | |
| 33943 | /* disable digital output channel 6 on port 2 * |
| 33944 | * (set to high-impedance), when the simulation terminates */ |
| 33945 | dio_tp4_digout_init(DIO_TP4_1_MODULE_ADDR, 2, DIO_TP4_MASK_CH6, |
| 33946 | DIO_TP4_LS_DISABLE, DIO_TP4_HS_DISABLE); |
| 33947 | |
| 33948 | /* Terminate for S-Function (rti_commonblock): '<S1079>/S-Function1' */ |
| 33949 | |
| 33950 | /* disable digital output channel 1 on port 2 * |
| 33951 | * (set to high-impedance), when the simulation terminates */ |
| 33952 | dio_tp4_pwm_init(DIO_TP4_1_MODULE_ADDR, 2, DIO_TP4_MASK_CH1, |
| 33953 | DIO_TP4_LS_DISABLE, DIO_TP4_HS_DISABLE, DIO_TP4_TIMING_RANGE2, |
| 33954 | DIO_TP4_PWM); |
| 33955 | |
| 33956 | /* Terminate for S-Function (rti_commonblock): '<S1080>/S-Function1' */ |
| 33957 | |
| 33958 | /* disable digital output channel 2 on port 2 * |
| 33959 | * (set to high-impedance), when the simulation terminates */ |
| 33960 | dio_tp4_pwm_init(DIO_TP4_1_MODULE_ADDR, 2, DIO_TP4_MASK_CH2, |
| 33961 | DIO_TP4_LS_DISABLE, DIO_TP4_HS_DISABLE, DIO_TP4_TIMING_RANGE2, |
| 33962 | DIO_TP4_PWM); |
| 33963 | |
| 33964 | /* Terminate for S-Function (rti_commonblock): '<S414>/S-Function1' incorporates: |
| 33965 | * SubSystem: '<S405>/Background_Task' |
| 33966 | */ |
| 33967 | L4_MAB_Background_Task_Term(); |
| 33968 | |
| 33969 | /* End of Terminate for S-Function (rti_commonblock): '<S414>/S-Function1' */ |
| 33970 | |
| 33971 | /* Terminate for S-Function (rti_commonblock): '<S420>/S-Function1' incorporates: |
| 33972 | * SubSystem: '<S405>/Interrupt_Task' |
| 33973 | */ |
| 33974 | L4_MABX_Interrupt_Task_Term(); |
| 33975 | |
| 33976 | /* End of Terminate for S-Function (rti_commonblock): '<S420>/S-Function1' */ |
| 33977 | |
| 33978 | /* Terminate for S-Function (rti_commonblock): '<S466>/S-Function1' */ |
| 33979 | |
| 33980 | /* dSPACE RTICAN STD Srvc-Message Block */ |
| 33981 | { |
| 33982 | /* ... Set the message into sleep mode */ |
| 33983 | while ((rtican_type1_tq_error[0][0] = can_tp1_msg_sleep |
| 33984 | (CANTP1_RX_SPMSG_M1_C1_STD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 33985 | } |
| 33986 | |
| 33987 | /* dSPACE RTICAN XTD Srvc-Message Block */ |
| 33988 | { |
| 33989 | /* ... Set the message into sleep mode */ |
| 33990 | while ((rtican_type1_tq_error[0][1] = can_tp1_msg_sleep |
| 33991 | (CANTP1_RX_SPMSG_M1_C1_XTD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 33992 | } |
| 33993 | |
| 33994 | /* Terminate for S-Function (rti_commonblock): '<S467>/S-Function1' */ |
| 33995 | |
| 33996 | /* dSPACE RTICAN STD Srvc-Message Block */ |
| 33997 | { |
| 33998 | /* ... Set the message into sleep mode */ |
| 33999 | while ((rtican_type1_tq_error[0][0] = can_tp1_msg_sleep |
| 34000 | (CANTP1_RX_SPMSG_M1_C2_STD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 34001 | } |
| 34002 | |
| 34003 | /* dSPACE RTICAN XTD Srvc-Message Block */ |
| 34004 | { |
| 34005 | /* ... Set the message into sleep mode */ |
| 34006 | while ((rtican_type1_tq_error[0][1] = can_tp1_msg_sleep |
| 34007 | (CANTP1_RX_SPMSG_M1_C2_XTD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 34008 | } |
| 34009 | |
| 34010 | /* Terminate for S-Function (rti_commonblock): '<S468>/S-Function1' */ |
| 34011 | |
| 34012 | /* dSPACE RTICAN STD Srvc-Message Block */ |
| 34013 | { |
| 34014 | /* ... Set the message into sleep mode */ |
| 34015 | while ((rtican_type1_tq_error[1][0] = can_tp1_msg_sleep |
| 34016 | (CANTP1_RX_SPMSG_M2_C1_STD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 34017 | } |
| 34018 | |
| 34019 | /* dSPACE RTICAN XTD Srvc-Message Block */ |
| 34020 | { |
| 34021 | /* ... Set the message into sleep mode */ |
| 34022 | while ((rtican_type1_tq_error[1][1] = can_tp1_msg_sleep |
| 34023 | (CANTP1_RX_SPMSG_M2_C1_XTD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 34024 | } |
| 34025 | |
| 34026 | /* Terminate for S-Function (rti_commonblock): '<S469>/S-Function1' */ |
| 34027 | |
| 34028 | /* dSPACE RTICAN STD Srvc-Message Block */ |
| 34029 | { |
| 34030 | /* ... Set the message into sleep mode */ |
| 34031 | while ((rtican_type1_tq_error[1][0] = can_tp1_msg_sleep |
| 34032 | (CANTP1_RX_SPMSG_M2_C2_STD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 34033 | } |
| 34034 | |
| 34035 | /* dSPACE RTICAN XTD Srvc-Message Block */ |
| 34036 | { |
| 34037 | /* ... Set the message into sleep mode */ |
| 34038 | while ((rtican_type1_tq_error[1][1] = can_tp1_msg_sleep |
| 34039 | (CANTP1_RX_SPMSG_M2_C2_XTD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 34040 | } |
| 34041 | |
| 34042 | /* Terminate for S-Function (rti_commonblock): '<S470>/S-Function1' */ |
| 34043 | |
| 34044 | /* dSPACE RTICAN STD Srvc-Message Block */ |
| 34045 | { |
| 34046 | /* ... Set the message into sleep mode */ |
| 34047 | while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep |
| 34048 | (CANTP1_RX_SPMSG_M3_C1_STD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 34049 | } |
| 34050 | |
| 34051 | /* dSPACE RTICAN XTD Srvc-Message Block */ |
| 34052 | { |
| 34053 | /* ... Set the message into sleep mode */ |
| 34054 | while ((rtican_type1_tq_error[2][1] = can_tp1_msg_sleep |
| 34055 | (CANTP1_RX_SPMSG_M3_C1_XTD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 34056 | } |
| 34057 | |
| 34058 | /* Terminate for S-Function (rti_commonblock): '<S471>/S-Function1' */ |
| 34059 | |
| 34060 | /* dSPACE RTICAN STD Srvc-Message Block */ |
| 34061 | { |
| 34062 | /* ... Set the message into sleep mode */ |
| 34063 | while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep |
| 34064 | (CANTP1_RX_SPMSG_M3_C2_STD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 34065 | } |
| 34066 | |
| 34067 | /* dSPACE RTICAN XTD Srvc-Message Block */ |
| 34068 | { |
| 34069 | /* ... Set the message into sleep mode */ |
| 34070 | while ((rtican_type1_tq_error[2][1] = can_tp1_msg_sleep |
| 34071 | (CANTP1_RX_SPMSG_M3_C2_XTD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 34072 | } |
| 34073 | } |
| 34074 | |